# How do I move an object upwards?

**URL:** <https://discourse.processing.org/t/how-do-i-move-an-object-upwards/15288>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [November 7, 2019, 3:04am UTC](https://discourse.processing.org/t/how-do-i-move-an-object-upwards/15288 "2019-11-07T03:04:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ImConfused](https://avatars.discourse-cdn.com/v4/letter/i/7feea3/32.png) [@ImConfused](https://discourse.processing.org/u/ImConfused)\
**Post date:** [November 7, 2019, 3:04am UTC](https://discourse.processing.org/t/how-do-i-move-an-object-upwards/15288/1 "2019-11-07T03:04:17Z")

</div>

I need help I’m doing this project and I don’t know how to move the object upwards.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/e/e81a755d1343b939eb856083189ea2605ec97899.jpeg)

---

<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:** [November 7, 2019, 3:29am UTC](https://discourse.processing.org/t/how-do-i-move-an-object-upwards/15288/2 "2019-11-07T03:29:18Z")

</div>

make the rocket a extra shape or function  
and change y

```auto
y--;
myRocket(x,y);

```

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [November 7, 2019, 6:52am UTC](https://discourse.processing.org/t/how-do-i-move-an-object-upwards/15288/3 "2019-11-07T06:52:06Z")

</div>

in draw()

```auto
translate (200,y);
// draw rocket
y--;

```

And also in `setup()` say `y=height + 50;` or similar to set the initial value for `y`.

Chrisir

---

<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:** [November 11, 2019, 7:48pm UTC](https://discourse.processing.org/t/how-do-i-move-an-object-upwards/15288/4 "2019-11-11T19:48:15Z")

</div>

The key thing is to update the location variable for the height (for example, y). If you do it each time draw runs, the rocket while move up for as long as the sketch is running, flying off the screen.

If you are trying to draw an object in a different place, it may also help you to review these intro tutorials on coordinates and 2D transformations:

- [https://processing.org/tutorials/drawing/](https://processing.org/tutorials/drawing/)
- [https://processing.org/tutorials/transform2d/](https://processing.org/tutorials/transform2d/)
