If this is true, do this AGAIN and AGAIN, program will get STRUCK POSSIBILY, while(true) {it will continuous looping}

If this is true, do THIS

//Difference with **while** & **for** loop

//while loop
var x = 0;
while(x <= width){
x = x + 50;

//for loop
for (var x = 0; x <= width; x += 50) {
    fill(255, 0, 200);
    ellipse(x, 300, 25, 25);
  }
//var x=0 --> start
//x<= width --> stop
//x += 50 --> repeat
//"for" loop is taking everything from the "while" loop and condensing it

offset = offset + 1
//offseting the location by 1 pixel, every circle moves continuously to the right by 1 pixel

//how to draw circles on x axis and y axis
//for every X fill in all the Ys
for (var x = 0;.......)
for (var y = 0;.......)

Note that if only one value is provided to color(), it will be interpreted as a grayscale value. Add a second value, and it will be used for alpha transparency. When three values are specified, they are interpreted as either RGB or HSB values. Adding a fourth value applies alpha transparency.

Screen Shot 2022-09-20 at 12.24.48 PM.png

Conditional Project:

I partnered with Lan with this project and we ended up making a slightly different than each other but having some similar conditional functions that we discussed with each other in the beginning. We both agreed on making a light switch that changes either the sky color outside the window or the background color. Our intention was to create a button switch that could allow us change the color. I ended up changing the three sides of the walls individually when clicking each side of the wall. Also, I added some rain falling from outside the window to the indoor of the room, created a ball that moves horizontally as if the dog is chasing after it, a button that you can turn on the lights, a color changing dog.

Question:

  1. I actually tried several different methods on how to move the ball rolling the side of the wall from the right end to the left bottom end. However, the result came out a little bit robotic. I was thinking how I can make the moving route more lifely.