Moving Sprites

You now know how to make sprites, but how do you make them move? That’s what this chapter is all about. We’re going to take a close look at all the code you have to write to start making your sprites move around the stage. You’ll learn about

  • Making a game loop
  • Using velocity properties
  • Modularizing your animation code by using game states
  • Making a sprite move by using the keyboard
  • Containing a sprite’s movement inside the canvas
  • Applying physics to a sprite’s movement

At the end of this chapter, you’ll be well prepared to apply these techniques to all kinds of interactive games and applications, so let’s get started! ...

Get Learn Pixi.js: Create Great Interactive Graphics for Games and the Web now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.