Skip to main content

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD 54.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 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

Authors

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics