Chapter 9 of Beginning Game Programming teaches developers how to move sprites around the screens with different behaviors.

This example creates 3 different planet sprites, each with their own movement behavior. Mars stops when it hits the edge of the screen. Neptune ricochets off the edges. Jupiter wraps around the screen.

For added fun, you can click and drag the planets around the screen and they will change their velocity and direction when you let them go.


Download NowName your own price

Click download now to get access to the following files: 10 MB 56 kB

Leave a comment

Log in with to leave a comment.