# I'm in a hurry! Dual cycle of how to move up and down

**URL:** <https://discourse.processing.org/t/im-in-a-hurry-dual-cycle-of-how-to-move-up-and-down/6640>\
**Category:** Coding Questions\
**Created:** [December 15, 2018, 11:02pm UTC](https://discourse.processing.org/t/im-in-a-hurry-dual-cycle-of-how-to-move-up-and-down/6640 "2018-12-15T23:02:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lin](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@lin](https://discourse.processing.org/u/lin)\
**Post date:** [December 15, 2018, 11:02pm UTC](https://discourse.processing.org/t/im-in-a-hurry-dual-cycle-of-how-to-move-up-and-down/6640/1 "2018-12-15T23:02:20Z")

</div>

```auto
void setup() {
  size(640, 360); 
  noStroke();
  rectMode(CENTER);
}

void draw() {
  background(51); 
  fill(255, 204);
  rect(mouseX, height/2, mouseY/2+10, mouseY/2+10);
  fill(255, 204);
  int inverseX = width-mouseX;
  int inverseY = height-mouseY;
  rect(inverseX, height/2, (inverseY/2)+10, (inverseY/2)+10);
}

```

Move up and down the program how to do?

Novice is not too will do  
I hope to help!!  
please…

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [December 16, 2018, 12:59am UTC](https://discourse.processing.org/t/im-in-a-hurry-dual-cycle-of-how-to-move-up-and-down/6640/2 "2018-12-16T00:59:55Z")

</div>

hi Lin  
as you use the

- mouseX for left/right and
- mouseY for rectangle size

already  
how to make a additional up down?  
could use the mouseWheel  
[https://processing.org/reference/mouseWheel\_.html](https://processing.org/reference/mouseWheel_.html)

like in

```auto
float updown=0;

void setup() {
  size(640, 360); 
  noStroke();
  rectMode(CENTER);
}

void draw() {
  background(51); 
  fill(255, 204);
  rect(mouseX, height/2+updown, mouseY/2+10, mouseY/2+10);
  fill(255, 204);
  int inverseX = width-mouseX;
  int inverseY = height-mouseY;
  rect(inverseX, height/2+updown, (inverseY/2)+10, (inverseY/2)+10);
}

void mouseWheel(MouseEvent event) {
  float e = event.getCount();
  updown += 5*e;
}

```

from your title??  
you talk circle, but you make rectangles??  
check on  
[https://processing.org/reference/ellipse\_.html](https://processing.org/reference/ellipse_.html)

---

<div class="post-metadata">

**Author:** ![lin](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@lin](https://discourse.processing.org/u/lin)\
**Post date:** [December 16, 2018, 10:13pm UTC](https://discourse.processing.org/t/im-in-a-hurry-dual-cycle-of-how-to-move-up-and-down/6640/3 "2018-12-16T22:13:33Z")

</div>

Trajectory is ring  
Not the shape

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [December 16, 2018, 10:15pm UTC](https://discourse.processing.org/t/im-in-a-hurry-dual-cycle-of-how-to-move-up-and-down/6640/4 "2018-12-16T22:15:26Z")

</div>

> Trajectory is ring  
> Not the shape

I don’t understand what that means.

Please explain using more words and more details.

---

<div class="post-metadata">

**Author:** ![lin](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@lin](https://discourse.processing.org/u/lin)\
**Post date:** [December 17, 2018, 2:06pm UTC](https://discourse.processing.org/t/im-in-a-hurry-dual-cycle-of-how-to-move-up-and-down/6640/5 "2018-12-17T14:06:35Z")

</div>

Is a round，no ring sorry

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [December 17, 2018, 2:08pm UTC](https://discourse.processing.org/t/im-in-a-hurry-dual-cycle-of-how-to-move-up-and-down/6640/6 "2018-12-17T14:08:51Z")

</div>

what is your status, did you changed the rect to ellipse already?  
if you have more questions pls. paste your actual code
