# 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:** 1\
**Showing post:** 2

<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...");
  }
}

```

---

_[View the full topic](https://discourse.processing.org/t/array-and-object-moving-and-not-moving-coding-questions/698)._
