上QQ阅读APP看书,第一时间看更新
Chapter 2. Storing and Manipulating Data
Variables are a Programmer's Best Friend
If someone asked if it were raining, or which bag had more apples in it, it would be a pretty simple conversation. But how do you have that same conversation with a computer? In this chapter we're going to take a look at how to use variables and flow control to get our code to react to what's going on in the game.
In this chapter we will:
- Discuss different types of variables including booleans, structs, enums, and arrays.
- Learn how to set default properties for variables and how to let level designers change them.
- Use operators on variables to add, subtract, and more.
- Learn about using flow control to do different things under different circumstances.
Let's get started by learning about the different types of variables!