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 ...
Get Learning Java by Building Android Games - Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.