Help! I have a student who is trying to move a simple object up and down the screen to create a game similar to pong. We keep getting a trail of images like it is growing verses moving on the screen to a new location. Could anyone help? I am really confused about what we are doing wrong. Thanks.
Can you give us a little more info so we can assist you better? You’ve covered some of them but the link to the project is really helpful so we can find issues:
- Link to your project: click the “Share” button at the top of the page and paste the link it produces into your post.
- Are there any particular steps that cause the error?
- What did you expect the program to do?
- What did it do instead?
@mkmietowicz is correct that we can better diagnose it if we have a link, but my first thought was that you need to redraw the background each time you move the sprite so the “old instance” of the sprite is erased as the new one is drawn. This involves putting your background block inside the draw loop and update the x or y value of the sprite inside the draw loop as well.
Hope this helps a little!