Swipe to navigate through the chapters of this book
In this chapter, we will show how to create a game world by storing information in the memory. We will introduce basic (numerical) types and variables, and how they can be used to store or change information. We will discuss the difference between instructions and expressions, and we will introduce a number of operators that can be used to combine expressions. We will show you how to store more complicated information such as sprites and sounds, and how you can use them to draw a nice-looking game world with sounds. We will present a few examples that illustrate how the information stored in the memory is updated and drawn in the game loop.
Please log in to get access to this content
To get access to this content you need the following product:
In fact, the Color type consists of four elements: the R, G, and B values, as well as an A (alpha) value that stores the transparency. For now, we are only using the first three elements.
- Creating a Game World
Jeroen D. Fokker
Mark H. Overmars
- Springer Berlin Heidelberg
- Sequence number
- Chapter number
- Chapter 4