# Side 2 is not working

**URL:** <https://forum.code.org/t/side-2-is-not-working/37471>\
**Category:** Coding and Debugging Help\
**Created:** [January 12, 2023, 8:03pm UTC](https://forum.code.org/t/side-2-is-not-working/37471 "2023-01-12T20:03:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorikaye](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@lorikaye](https://forum.code.org/u/lorikaye)\
**Post date:** [January 12, 2023, 8:03pm UTC](https://forum.code.org/t/side-2-is-not-working/37471/1 "2023-01-12T20:03:15Z")

</div>

Can you help me find the bug in this code?

> **[Check out what I made](https://studio.code.org/projects/gamelab/ak9PrlON5OfLNMizhLDtcSKiBNGEHZGFjQPaINhIAtg)**
>
> I wrote the code myself with Code.org

What is supposed to happen: The gas can and tire are supposed to come down the screen at an angle. There is a variable called side that is set to random number 1 or 2. If side ==1 then gas can is on the right and tire is on the left. If side==2, it is the opposite.

**What actually happens:** Right now, side 1 is working correctly but side 2 is not.

---

<div class="post-metadata">

**Author:** ![melynn](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/melynn/32/4925_2.png) [@melynn](https://forum.code.org/u/melynn)\
**Post date:** [January 13, 2023, 2:43pm UTC](https://forum.code.org/t/side-2-is-not-working/37471/2 "2023-01-13T14:43:42Z")

</div>

Hi @lorikaye,

I love the graphics! Very realistic.

To problem solve this issue…what is the only difference between function side1 and function side2? In function side2, you are also resetting the x positions of each sprite. Remember, the draw loop will set this exact same x position for as long as the condition is true. So, although velocity x is set for each sprite, the x position keeps moving to the same place each time through the loop. Line 76 and 77 will need to be moved if you want the sprites to move diagonally.

Hope this helps!  
Michelle
