Chapter 8

Motion and Animation

In This Chapter

arrow Understanding the basic physics principles used in gaming

arrow Adding a force vector to your sprites

arrow Using a force vector for space simulation

arrow Adding drag and skidding behavior

arrow Working with gravity

arrow Building multi-image animations

Sprites move around on the screen. That’s the central part of most games. But if you’ve looked at Chapters 6 and 7, you’ve seen that the sprite motion was somewhat simplistic in those chapters. Now you find out how to add more zip to your sprites. You make sprites accelerate smoothly, slow down with drag, skid around corners, and fall off cliffs.

All of these fun effects are made possible by understanding a little about how things move in the real world. In school, they called that physics class. Don’t worry, though. This will be the most fun you’ve ever had with physics. We make missiles.

Physics — Even More Fun ...

Get HTML5 Game Development For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.