Game Development Reference
In-Depth Information
1.2.3 Positions
Positions in 2D space are represented by 2 decimal numbers, defined by the X and Y vari-
ables. The simplest representation of this in code is
point p = new point(10.f, 5.f);
A point, represents a position in some space, in our case this is either a 2D space or a 3D
space. If we wish to move this point, we can change its position by changing its X and/or
Y values, we can also add a value to either X or Y and this will translate the point into a
newposition. Thearithmetic forpointsisthesameasforvectors,thisiswhyoftenvectors
are used to represent points.
Search WWH ::




Custom Search