Chapter 3: Variables, Operators, and Expressions
We are going to make good progress in this chapter. We will learn about Java variables that allow us to give our game the data it needs. By doing this, things such as the sub's location and whether it has been hit will soon be possible to code. Furthermore, we will look at the use of operators and expressions, which will enable us to change and mathematically manipulate this data as the game is executing.
In this chapter, we will cover the following topics:
- Handling syntax and jargon
- Having a full discussion about Java variables, including types, references, primitives, declaration, initialization, casting, concatenation, and more
- Practicing writing code to use and manipulate variables with operators and expressions
- Learning about the Android screen coordinate system for drawing text and graphics to the screen
- Using what we have learned to add variables to the Sub' Hunter game
- Learning how to...