# Array and object moving and not moving Coding Questions

**URL:** https://discourse.processing.org/t/array-and-object-moving-and-not-moving-coding-questions/698
**Category:** Coding Questions
**Created:** [June 4, 2018, 12:23am UTC](https://discourse.processing.org/t/array-and-object-moving-and-not-moving-coding-questions/698 "2018-06-04T00:23:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ryanho123](https://avatars.discourse-cdn.com/v4/letter/r/e480ec/32.png) [@ryanho123](https://discourse.processing.org/u/ryanho123)
#### Post date: [June 4, 2018, 12:23am UTC](https://discourse.processing.org/t/array-and-object-moving-and-not-moving-coding-questions/698/1 "2018-06-04T00:23:15Z")

</div>

Hello,

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.

---

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [June 4, 2018, 12:39pm UTC](https://discourse.processing.org/t/array-and-object-moving-and-not-moving-coding-questions/698/2 "2018-06-04T12:39:58Z")

</div>

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 “Countdown.java”: 🕶

- [https://Forum.Processing.org/two/discussion/27733/countdown-class-library-for-java-js-python](https://Forum.Processing.org/two/discussion/27733/countdown-class-library-for-java-js-python)

```java
/**
 * Countdown Pause/Resume Example (v1.0)
 * GoToLoop (2018/Jun/04)
 *
 * https://Discourse.Processing.org/t/
 * 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() {
  managePause();
  background(paused? #FF0000 : #0000FF);
}

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

```
