# How do I create a circle appears and floats circles but doesnt move out of the frame? something like the example below

**URL:** https://discourse.processing.org/t/how-do-i-create-a-circle-appears-and-floats-circles-but-doesnt-move-out-of-the-frame-something-like-the-example-below/39290
**Category:** Coding Questions
**Tags:** homework
**Created:** [October 16, 2022, 4:43am UTC](https://discourse.processing.org/t/how-do-i-create-a-circle-appears-and-floats-circles-but-doesnt-move-out-of-the-frame-something-like-the-example-below/39290 "2022-10-16T04:43:38Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![andreasarmiento](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@andreasarmiento](https://discourse.processing.org/u/andreasarmiento)
#### Post date: [October 16, 2022, 4:43am UTC](https://discourse.processing.org/t/how-do-i-create-a-circle-appears-and-floats-circles-but-doesnt-move-out-of-the-frame-something-like-the-example-below/39290/1 "2022-10-16T04:43:39Z")

</div>

![0227254D-25E1-45B1-8251-153F6B216282](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/d/7/d764a34f2926fd20f37362a654ecba2a5936b683.gif)

---

<div class="post-metadata">

### Author: ![NumericPrime](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/numericprime/32/16318_2.png) [@NumericPrime](https://discourse.processing.org/u/NumericPrime)
#### Post date: [October 16, 2022, 5:45am UTC](https://discourse.processing.org/t/how-do-i-create-a-circle-appears-and-floats-circles-but-doesnt-move-out-of-the-frame-something-like-the-example-below/39290/2 "2022-10-16T05:45:19Z")

</div>

I would create a class for the circles.  
This class stores the color, position and size of the circles.  
I would do the movement with the noise(int,int) function though I strongly recommend scaling the inputs down (the first will get the current frame and the second some integer).  
An easy way of keeping the number of circles constant would be to create a new circle object once the original one reached the end of its life.

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [October 16, 2022, 6:26am UTC](https://discourse.processing.org/t/how-do-i-create-a-circle-appears-and-floats-circles-but-doesnt-move-out-of-the-frame-something-like-the-example-below/39290/3 "2022-10-16T06:26:06Z")

</div>

Hi

Doesn’t move out of the frame … So when it’s reach the frame what then ?? Bounce back or disappear etc or what ??

---

<div class="post-metadata">

### Author: ![andreasarmiento](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@andreasarmiento](https://discourse.processing.org/u/andreasarmiento)
#### Post date: [October 16, 2022, 9:53am UTC](https://discourse.processing.org/t/how-do-i-create-a-circle-appears-and-floats-circles-but-doesnt-move-out-of-the-frame-something-like-the-example-below/39290/4 "2022-10-16T09:53:12Z")

</div>

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/3/0/305c8865a8c2624b9a90e2bbc73943ca5609da64.gif)

So i have this now…. Im going use one colour only and then When the bottom part of the screen is pressed, i want those green circles to drop at the bottom and disappear.

Can you add me on discord 😭 it’s ANDREA#6023

---

<div class="post-metadata">

### Author: ![andreasarmiento](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@andreasarmiento](https://discourse.processing.org/u/andreasarmiento)
#### Post date: [October 16, 2022, 9:53am UTC](https://discourse.processing.org/t/how-do-i-create-a-circle-appears-and-floats-circles-but-doesnt-move-out-of-the-frame-something-like-the-example-below/39290/5 "2022-10-16T09:53:52Z")

</div>

do you have an example, im actually quite confused with how to use class ☹

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [October 16, 2022, 10:05am UTC](https://discourse.processing.org/t/how-do-i-create-a-circle-appears-and-floats-circles-but-doesnt-move-out-of-the-frame-something-like-the-example-below/39290/6 "2022-10-16T10:05:31Z")

</div>

Hi idea about bouncing

> [@Bubble popping animation](https://discourse.processing.org/t/bubble-popping-animation/15341):
>
> Hi Me and my son are following Daniel Shiffman’s learn processing guide on YT. We are on creating objects and are want to make a bubble. This bubble is wobbling and rising but we also want it to pop when clicked on. It doesn’t need to be realistic but We are looking for a type of animation we’re the ellipse turns in to a point that falls down. Also a small number of particles “exploding” from the ellipse when it disappears… Can anyone help us with this code? If so. Please comment in code si…

[![](https://img.youtube.com/vi/8AgJaf8Xjsw/maxresdefault.jpg "Bouncing Balls in Proccessing") ](https://www.youtube.com/watch?v=8AgJaf8Xjsw)

> **[Bouncy Bubbles / Examples](https://processing.org/examples/bouncybubbles.html)**
>
> Multiple-object collision.

---

<div class="post-metadata">

### Author: ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)
#### Post date: [October 16, 2022, 10:50am UTC](https://discourse.processing.org/t/how-do-i-create-a-circle-appears-and-floats-circles-but-doesnt-move-out-of-the-frame-something-like-the-example-below/39290/7 "2022-10-16T10:50:58Z")

</div>

Hi @andreasarmiento,

This might help 😉

> [@Problems with my mini game](https://discourse.processing.org/t/problems-with-my-mini-game/21949/2):
>
> Hi, Welcome to the community! slight_smile Before trying to solve your problem, you are facing a well known problem where the structure of your code is actually describing [object oriented programming](https://en.wikipedia.org/wiki/Object-oriented_programming) : So object oriented programming is a way to structure your code by using objects to model the data that your are manipulating. In this special case, your are creating Balls, and a Ball is described as : a position (x and y coordinates on the screen) a speed (described as a vector, xDir and y…
