Sprites not disappearing after moving

Students sprites are not disappearing after they are moving.

Students are using:

If ( keyDown(“right”)) {
sprite.x = sprite.x +1;
keyDown (“up”). setAnimation(spriteUp)
}

The sprite shows the path it takes and creates a new sprite every time. What is wrong???

Hi, I don’t understand what this line of code is supposed to do:

keyDown (“up”). setAnimation(spriteUp)

‘keyDown(“up”)’ is not a sprite, so you can’t set its animation. I also don’t know what the value of the “SpriteUp” variable is. Can you link to the student project to help us understand what is happening in the program?

1 Like