Game Development Reference
In-Depth Information
Topics Covered In This Chapter:
— Cartesian coordinate systems.
— The X-axis and Y-axis.
— The Commutative Property of Addition.
— Absolute values and the abs() function.
This chapter does not introduce a new game, but instead goes over some simple
mathematical concepts that we will use in the rest of the games in this topic.
When you look at 2D games (such as Tetris or old Super Nintendo or Sega Genesis
games) you can see that most of the graphics on the screen can move left or right (the first
dimension) and up or down (the second dimension, hence 2D). In order for us to create
games that have objects moving around two dimensions (such as the two dimensional
computer screen), we need a system that can translate a place on the screen to integers that
our program can deal with.
This is where Cartesian coordinate systems come in. The coordinates can point to a very
specific point on the screen so that our program can keep track of different areas on the
screen.
Negative numbers are often used with Cartesian coordinate systems as well. The second
half of this chapter will explain how we can do math with negative numbers.
You may already know about Cartesian coordinate systems and negative numbers from
math class. In that case, you can just give this chapter a quick read anyway to refresh
yourself.
Search WWH ::




Custom Search