save.png
notes
X

don't forget to open your JavaScript console on Firefox before doing anything else: option + command + K on Mac ( or control + shift + K on PC ) or in the menu Tools > Web Developers > Web Console.



shape functions
ellipse( x, y, width, height );
rect( x, y, width, height, border-radius );
triangle(x1,y1,x2,y2,x3,y3);
line(x1,y1,x2,y2);

color functions
fill( r, g, b, a );
fill('color');
noFill();
stroke( r, g, b, a );
stroke('color');
noStroke();

other functions
random( min, max );
translate( x, y );
rotate( degrees );

for loops
for (var i=0; i<10; i+=1) {

};
variables

width
height

declarations
var x = 100;
var x = 1.5;
var x = "hello";

arithmetic
x + 5;
x - 5;
x / 5;
x * 5;

increment
x = x + 5;
x += 5;
x = x - 5;
x -= 5;

boolean expressions
( x == y ) // is x equal to y
( x != y ) // is x not equal to y
( x >= y ) // is x greater than or equal to y
( x > y ) // is x greater than y
( x <= y ) // is x less than or equal to y
( x < y ) // is x less than to y

( x < y && x > z ) // if first expression and second are true
( x < y || x > z ) // if first expression or second are true


conditional statements
if( boolean expression ){

}
else if( boolean expression ) {

}
else {

}