CHAPTER 5

image

Animating Sprites

So far in this book, you’ve learned how to make sprites, move them, and make them interactive. But what if you want to make a game character that can flap its wings, or move its arms and legs to walk around the game world? You have to use a technique called keyframe animation: displaying a series of slightly different images in sequence to create the illusion of motion. Pixi has some built-in tools to make keyframe animation easy, and that’s what this chapter is all about.

  • Using MovieClip sprites
  • Making animation frames using a texture atlas or tileset
  • Using a custom sprite function for full-featured control over ...

Get Learn Pixi.js: Create Great Interactive Graphics for Games and the Web 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.