Chapter 3 Build Your First Game with Rust

Hands-on Rust — by Herbert Wolverson (32 / 120)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Wrap-Up | TOC | Understanding the Game Loop 👉

The previous chapters set down a solid foundation for installing and working with Rust. This chapter puts that knowledge to use and walks you through developing your first game, Flappy Dragon — a Flappy Bird clone.[34]

You’ll start by adding a game engine to your project dependencies, which you’ll use to implement your game loop. You’ll then test the game loop with a simple “Hello” program. From there, you’ll implement basic program flow with a state machine, add a player, simulate gravity, and make the player’s dragon flap its wings. Finally, you’ll add obstacles and scorekeeping to the game. By the end of this chapter, you’ll have a complete game — completely built in Rust.

Before you begin building Flappy Dragon, you first need to understand the game loop.

👈 Wrap-Up | TOC | Understanding the Game Loop 👉

Hands-on Rust by Herbert Wolverson can be purchased in other book formats directly from the Pragmatic Programmers. If you notice a code error or formatting mistake, please let us know here so that we can fix it.

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.