# Conditionals for resetting moving object

**URL:** https://discourse.processing.org/t/conditionals-for-resetting-moving-object/39389
**Category:** Coding Questions
**Created:** [October 22, 2022, 8:26pm UTC](https://discourse.processing.org/t/conditionals-for-resetting-moving-object/39389 "2022-10-22T20:26:28Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![turtle1](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@turtle1](https://discourse.processing.org/u/turtle1)
#### Post date: [October 22, 2022, 8:26pm UTC](https://discourse.processing.org/t/conditionals-for-resetting-moving-object/39389/1 "2022-10-22T20:26:28Z")

</div>

hi, i want to repeat a moving object using a conditional statement. my object moves off the canvas, but i want that to keep repeating from the top. i have my conditional statement, but how would i incorporate the two?

---

<div class="post-metadata">

### Author: ![debxyz](https://avatars.discourse-cdn.com/v4/letter/d/58956e/32.png) [@debxyz](https://discourse.processing.org/u/debxyz)
#### Post date: [October 22, 2022, 9:07pm UTC](https://discourse.processing.org/t/conditionals-for-resetting-moving-object/39389/2 "2022-10-22T21:07:40Z")

</div>

Hello @turtle1  
Please post your code. Then we can see your thought process and offer the best guidance. 🙂

Also, if I’m reading your question correctly, you want your moving object to appear at the top of the screen after it has moved outside of the bottom frame edge. Is that correct?

_ **Please note** _ “Reset object to beginning x, y position” is perhaps a better title for your question.

🤓

---

<div class="post-metadata">

### Author: ![vkbr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/vkbr/32/16844_2.png) [@vkbr](https://discourse.processing.org/u/vkbr)
#### Post date: [October 23, 2022, 3:01am UTC](https://discourse.processing.org/t/conditionals-for-resetting-moving-object/39389/3 "2022-10-23T03:01:58Z")

</div>

generically speaking `if(condition){y=0;}`?

---

<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: [October 23, 2022, 3:05am UTC](https://discourse.processing.org/t/conditionals-for-resetting-moving-object/39389/4 "2022-10-23T03:05:08Z")

</div>

Well done

And what is your condition?

How can you detect if it’s left the screen?

---

<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: [October 26, 2022, 12:45pm UTC](https://discourse.processing.org/t/conditionals-for-resetting-moving-object/39389/5 "2022-10-26T12:45:05Z")

</div>

Please post your entire code to get real help
