Chapter 3
Creating a Game World
This chapter will show you how to create a game world by storing information in memory. I will introduce basic types and variables and how they can be used to store or change information. Next, you will see how to store more complicated information in objects that consist of member variables and methods.
Basic Types and Variables
The previous chapters discussed memory a couple of times. You have seen how to execute a simple instruction like backgroundColor = UIColor.blueColor() to set the background color of the app screen to a certain value. In this chapter’s example, you will use memory to store information temporarily, in order to remember the results of a few simple calculations.
Types
Types, or data types ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access