This chapter covers the basic aspects of programming games. We will introduce the game loop, which consists of two main parts: updating the world and drawing the world. We will show how this concept is defined by game engines and how it is used to create a simple game application. The game application is used to introduce a number of basic C# programming concepts, such as instructions, methods, classes, namespaces, and compilation units. We show that instructions are grouped in methods, and methods, in turn, are grouped in classes. We will show you can include libraries in your program that contain code written by others. We also discuss the basic rules of program layout and how to use comments to clarify your code.
Unable to display preview. Download preview PDF.