# Functions

This is list of functions with their variables, every function is described. There is recommended to read article Hotkeys, it's helpful to understand description of some functions.

* clear_area(int area_x, int area_y, int area_w, int area_h)* - (like CTRL-Erase) Clears the area with height

**h**and width

**w**. (

**x**,

**y**) is the top left corner.

* create_part(int p, int x, int y, int t)* - Creates particle which type is

**t**at [

**x**,

**y**]. For

**p**use -1.

* create_box(int x1, int y1, int x2, int y2, int c)* - Creates rectangle (like CTRL in PT).

*,*

**x1***is first corner position,*

**y1***,*

**x2***is second corner position,*

**y2****c**is particle type.

* create_line(int x1, int y1, int x2, int y2, int r, int c)* - Like

*, but*

**create_box***,*

**x1***,*

**y1***,*

**x2***are line ends position.*

**y2*** delete_part(int x, int y)* - Deletes part at defined position.

* flood_parts(int x, int y, int c, int cm, int bm)* - Flood fill. (

*,*

**x***) is the location to start the fill.*

**y***is the particle type to fill(not the particle itself but the number ex. PT_DUST). set*

**c***and*

**cm***to -1.*

**bm*** kill_part(int i)* - Deletes particle

*.(Does not use x,y location like delete_part)*

**i*** nearest_part(int ci,int t)* - Returns nearest particle of type

*.*

**t***is current particle.*

**ci*** parts_avg(int ci, int ni)* - Returns the part in between the particles

*and*

**ci***.*

**ni*** part_change_type(int i, int x, int y, int t)* - Changes type of particle

*.*

**i***is new type,*

**t***is the x location of the particle,*

**x***is the y location of the particle.*

**y**