Sprite seems to be duplicating when moved


#1

Hi everyone, two of my students who pulled in outside image are having trouble with these sprites on movement. Sharing…when we click the space bar to jump little lines seem to remain after the sprite comes back down and we aren’t sure whey.

Appreciate your help.

VaNessa


#2

It looks like the background is not being drawn every time through the draw loop.
Look at lines 40

  // draw background
  mario.velocityY = 0.5;

There is a comment there to draw the backgound but not the command to.


#3

Thank you.

What would the command look like? I’m not sure about this part either.


#4

background(‘white’) ;

I think…


#5

Thank you. That worked for him. Much appreciated.