Skip to Content
Programming 2D Games
book

Programming 2D Games

by Charles Kelly
June 2012
Beginner
438 pages
15h 26m
English
A K Peters/CRC Press
Content preview from Programming 2D Games
144 5. Sprites and Animation
Aer the velocities are determined, use them to change the x and y position
of the ship like this:
ship.setX(ship.getX() + frameTime * Xvelocity); // Apply X velocity
4. (Challenging.) Make the spaceship appear to orbit the planet as viewed from above.
at is, the ship should travel in a circle on the screen.
5. (Very challenging.) Make the spaceship appear to orbit the planet as it ies in front
of and then behind the planet. Start the ship 1/4 of the way across the screen and
centered vertically. Make the ship get bigger in size as it travels from le to right
until it is in the center of the screen, then start ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning 3D Game Programming

Beginning 3D Game Programming

Tom Miller

Publisher Resources

ISBN: 9781466508705