For Loop in Processing (snake game)

Your three ellipses are drawn at (250,250), (250,270), and (250,290). Notice that only the Y position changes. It starts at 250, and increases by 20 each time.

Your looping variable, i starts at 0, and then is 1, and then 2.

Consider what the value of (150 + 20 * i) is for each of these values for i.

Now try drawing an ellipse inside your loop. What is the X position? What is the Y position?!?

2 Likes