Unit 3 Lesson 28 Make a game

Hi Everyone,

My student is trying to make them move on their own accord for his game but when he tries the all the aliens are moving so fast and we are trying to figure out how to slow them down.

Any help you can offer?

@melkog

Good morning. Did you share the correct link? The project file I opened is just a shell of a game with comments, but no real coding blocks that would do anything.

Generally, however, the speed is determined by how many increments you are giving to the x and/or y value of each sprite each time through the draw loop, so frog.y=frog.y+2 will travel twice as fast as frog.y=frog.y+1.

If you still need help, please check the link and check back in with us!

Good luck!

Mike

Ah … ok…. I see what is happening here…

The ones that are moving fast are due to the random blocks. They aren’t really moving, they’re randomly changing positions and since their x value can be anywhere between 0 (left side) and 400 (right side), they could show up on the far right and instantly after on the far left and then the same thing again. You could restrict their range to a smaller range, but using the random x position, they will still be jittery. You would have to make them move like the other two aliens where you augment or decrease the x value by 1 or 2 for them to have the appearance of moving, but not bouncing from one side of the screen to the other.

Does this help?

Mike