# Movement Code Stops Working After Background Changes by Score

**URL:** <https://forum.code.org/t/movement-code-stops-working-after-background-changes-by-score/34766>\
**Category:** Coding and Debugging Help\
**Tags:** csd-unit-3\
**Created:** [May 26, 2021, 1:54pm UTC](https://forum.code.org/t/movement-code-stops-working-after-background-changes-by-score/34766 "2021-05-26T13:54:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsimpson](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@rsimpson](https://forum.code.org/u/rsimpson)\
**Post date:** [May 26, 2021, 1:54pm UTC](https://forum.code.org/t/movement-code-stops-working-after-background-changes-by-score/34766/1 "2021-05-26T13:54:04Z")

</div>

A student has coded this game and I cannot for the life of me figure out why the purple alien (player) stops moving after the score-triggered background change.

Any help is appreciated!!

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

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![IMPixel](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/impixel/32/6744_2.png) [@IMPixel](https://forum.code.org/u/IMPixel)\
**Post date:** [May 27, 2021, 12:19am UTC](https://forum.code.org/t/movement-code-stops-working-after-background-changes-by-score/34766/2 "2021-05-27T00:19:23Z")

</div>

In the function BGA2 your student is checking if score is higher than or equal to 30. If the score is higher than or equal to 30, the player’s x position will be set to 20. That’s why. Your student is running this every single frame, so its x position will be set to 20 every frame, without letting it move.

---

<div class="post-metadata">

**Author:** ![rsimpson](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@rsimpson](https://forum.code.org/u/rsimpson)\
**Post date:** [May 27, 2021, 1:39am UTC](https://forum.code.org/t/movement-code-stops-working-after-background-changes-by-score/34766/3 "2021-05-27T01:39:02Z")

</div>

Of course!

Thank you so much for your help!
