2 Building a game client
This chapter covers
- Getting familiar with Rust's game libraries
- Opening a window and render graphics in it
- Learning what makes a game's main loop
- Handling user input to control an entity
Every game consists of a client side application, the program that the user runs either on their PC, smartphone or gaming console. Naturally this is the starting point for us to build out.
In this chapter we are going to build a simple game client which allows us to add multiplayer features in the rest of the book. This is going to be our games-in-rust playground. We will be able to extend this further in later chapters when we add features like real time networking, persistence and accounting.
2.1 Approaching a Game Client
The goal of this chapter is to have a simple game that allows us to fly a 2D plane. We will utilize an external library so we do not have to worry about the most low level steps like window initialization and cross platform input handling. The Rust community created a wide range of these libraries already, we will give a brief overview over these and focus on one specifically in this book.