Array and object moving and not moving Coding Questions


I am new in here. Currently I am trying to figure out how to make 200 circle objects moving left to right for 5 seconds (using array). After 5 second, circle will not be moving for 2 second, then return to moving left to right for 5 seconds again (continued non-stopping). I know I can use frameRate(); and if-statement to make circles moving and not moving. However, I don’t know how to get started and where should I put Boolean conditions to my code. If someone can help me, it will be very great for me to understand this material. Thank you for your time.

P.S.: If you ask me for some specific questions regarding from my coding, I will share it to you.

Here’s an example which displays a blue background() for 5 seconds, followed by a red background() for 2 seconds, relying on a class library I coded called “”: :sunglasses:

 * Countdown Pause/Resume Example (v1.0)
 * GoToLoop (2018/Jun/04)
 * array-and-object-moving-and-not-moving-coding-questions/698/2

import gotoloop.countdown.Countdown;

final Countdown countdown = new Countdown();
boolean paused = true;

void draw() {
  background(paused? #FF0000 : #0000FF);

void managePause() {
  if (countdown.done) {
    countdown.delay = (paused ^= true)? 2000 : 5000;
    println("Paused:", paused, "\tAwaiting", 
      countdown.delay/1000, "seconds...");
1 Like