Quote:
Originally Posted by Phazonmutant
Regarding the actual class:
The D-pad is made from a standard x and a y axis (as you know), but each only return either 1 or -1. The if statements (ex: x < -0.5) would more simply be written like if(x = -1).
|
I think Mike did that intentionally because the values that are being used are floats. Because of this, you shouldn't perform equality checks on them, but rather check a range.
This page provides a good explanation on why this is the case. While the equality works most of the time, using .5 as the comparison point works all the time.