Looping code doesn't work

[Posts in the debugging category need to have the following pieces of information included in order to help other teachers or our moderator team best help you. Feel free to delete everything in brackets before posting your request for debugging help.]

Link to the project or level: Game Lab - Code.org

What I expect to happen: rocks to loop
What actually happens: never come back
What I’ve tried: switching the order of codes

Great start on that game.

Check to make sure you have the same rock resetting the same axis that you set the velocity for.

For example, for the sprite “rock” you set velocityx, then in the code when rock.y is greater than 450, you set rock.y to -50. So rock is off the screen at -50 on the y axis and moving across where we can’t see it. You need to change the code so the velocity and axis that you reset are the same. Similar problem with rock2.

Hope that helps you to debug the code.

1 Like