Abstract
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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
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.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Egges, A., Fokker, J.D., Overmars, M.H. (2013). Creating a Game World. In: Learning C# by Programming Games. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-36580-5_4
Download citation
DOI: https://doi.org/10.1007/978-3-642-36580-5_4
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-36579-9
Online ISBN: 978-3-642-36580-5
eBook Packages: Computer ScienceComputer Science (R0)