Chapter 4: Managing Animations with State Machines

In the last chapter, we created a minimal game engine, allowing for moving our main character around and playing a simple animation, but it's far from full-featured. There's no world to navigate, the only animation that plays is running, and Red Hat Boy (RHB) doesn't respond to any physics. At this point, if we wanted to retitle our game, it would be called Red Hat Boy and the Empty Void.

While that might be a fun title, it wouldn't make for a fun game. Ultimately, we'll want RHB to chase his dog through a forest with platforms to jump on and slide under, and to do that we'll need to make sure he slides, jumps, and runs. We'll also need to make sure that he looks, acts, and behaves differently ...

Get Game Development with Rust and WebAssembly 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.