# Creating object arrays without the object speeding up

**URL:** <https://discourse.processing.org/t/creating-object-arrays-without-the-object-speeding-up/46573>\
**Category:** Beginners\
**Created:** [June 18, 2025, 4:47pm UTC](https://discourse.processing.org/t/creating-object-arrays-without-the-object-speeding-up/46573 "2025-06-18T16:47:49Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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 18, 2025, 5:46pm UTC](https://discourse.processing.org/t/creating-object-arrays-without-the-object-speeding-up/46573/3 "2025-06-18T17:46:36Z")

</div>

> [@Pat](#):
>
> , I wanted 10 circles at random Y positions to move from right to left at random speeds…

You mean, something like this sketch:  
[https://OpenProcessing.org/sketch/1805772](https://OpenProcessing.org/sketch/1805772)

> [@Help with simple game (moving fish)](https://discourse.processing.org/t/help-with-simple-game-moving-fish/40679/9):
>
> You pick another value for nextFrameChange only after frameCount reached current nextFrameChange: if (frameCount \>= nextFrameChange) swapDirection(); It’s inside funtion swapDirection() that you change nextFrameChange: void swapDirection() { speed \*= -1; nextFrameChange = frameCount + 60 \* (int) random(5, 11); // 5s to 10s range } Anyways, I did a demo sketch that has a class Fish w/ methods such as display(), update(), bounce(), touchedBoundary(), etc.: Swimming\_Fish.pde /\*\* \* Swim…

---

_[View the full topic](https://discourse.processing.org/t/creating-object-arrays-without-the-object-speeding-up/46573)._
