xxxxxxxxxx
34
// coidng train example
//conditional logic is similar to boolean expressions
// the word boolean indicates if something is true or false
// this is also thought of as 1 or 0. 0 being false, 1 being true
//if (something is true){
//do this code
//} if soemthing is not true dont do the code
// create boolean expressions by using relational operators
// its an operator that is going to compare 2 numbers
function setup() {
createCanvas(600, 400);
}
function draw() {
background(0);
stroke(225);
strokeWeight(4);
noFill();
if (mouseX >300){
fill(255,0,200);
rectMode(CENTER);
rect(300, 200, 100,100);
}
ellipse(300,200,100,100);
}