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.

2.2 Library Selection and Setup

 
 
 

2.2.1 Terminology

 
 
 

2.2.2 Rust native game frameworks

 
 
 
 

2.2.3 Project Setup

 
 

2.3 Main loop

 
 

2.4 The Game Data Type

 
 

2.5 Running the Game

 
 
 

2.6 Drawing Shapes

 

2.7 Movement Controls

 
 
 

2.8 Drawing Images

 
 

2.9 Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest