Sprite Movement Error

Hi. Please leave any feedback or assistance you can with this student project.

Link to the project or level:

What I expect to happen:
The fish should swim to the left when the left arrow is pressed.

What actually happens:
The fish swim to the left but very slowly, regardless of the value placed in the equation.
What I’ve tried:
I know there is an extra “draw sprites” block included in the code but removing it had no effect on the outcome.

1 Like

@kjones,

There is a difference between “keyDown” and “keyWentDown”. You are using one with the blueFish and the right key and you are using the others with all of the fish and the left key.

keyWentDown only asks, did this key go down recently? If so, move two pixels. Then it’s done with its job. keyDown checks to see if the key is still down.

Does this help you out?

Mike

Yes it does. I totally overlooked that. Thank you so much.

يحرك السهم First Share badge on Code.org Professional Learning Community