# Please help with some debugging on student projects

**URL:** <https://forum.code.org/t/please-help-with-some-debugging-on-student-projects/39361>\
**Category:** Coding and Debugging Help\
**Created:** [April 24, 2024, 7:15pm UTC](https://forum.code.org/t/please-help-with-some-debugging-on-student-projects/39361 "2024-04-24T19:15:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlong](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@tlong](https://forum.code.org/u/tlong)\
**Post date:** [April 24, 2024, 7:15pm UTC](https://forum.code.org/t/please-help-with-some-debugging-on-student-projects/39361/1 "2024-04-24T19:15:58Z")

</div>

My students are making a side scroller game. They have a player that jumps to avoid an obstacle (that makes health go down) and try to touch a target (that makes the score go up).

I have analyzed the code for both of these and had students help scour the code for errors. We are not finding any. I may be overlooking something simple.

In this game, the present and coffin should move from right to left and loop back around at random heights. You will see that sometimes it dances around when it comes back to the right. Can you find what I am missing?

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

In this one, the salad and the rock should loop as they reach the left side. The salad tends to dance around. Again, I am not seeing an error in the code. I thought it may be because she drew her own sprites, but I replaced her sprites with sprites from the library and it still happened.

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

Thank you in advance for your keen eyes!  
Tracey

---

<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:** [April 25, 2024, 11:29am UTC](https://forum.code.org/t/please-help-with-some-debugging-on-student-projects/39361/2 "2024-04-25T11:29:13Z")

</div>

Hi @tlong,

Those are two fun games!

In the first game, take a look at line 61 and 62. It is the same as lines 54 and 55. It is also the reason the target doesn’t reset when it hits the player:)

In the second game, it is working well but the sprites are huge because the size includes a great deal of white space around the sprite. This fix requires that you crop all your sprites so that their collidable area includes only the sprite itself and not empty white space (or gray space in the animation tab) around the sprite. All you need to do is select each sprite on the left and then click on the crop button ![image](https://us1.discourse-cdn.com/flex016/uploads/codeorgforum/original/2X/e/efcd516500c7a28e97a1968e00b3743406f4d968.png).

Good luck!  
~Michelle

---

<div class="post-metadata">

**Author:** ![tlong](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@tlong](https://forum.code.org/u/tlong)\
**Post date:** [April 25, 2024, 6:05pm UTC](https://forum.code.org/t/please-help-with-some-debugging-on-student-projects/39361/3 "2024-04-25T18:05:13Z")

</div>

You are a genius! Thank you so much for the help!
