Game Development Reference
In-Depth Information
Internally, the SkierController class generates the steering value using the selected
input method from the title screen.
For keyboard input, the left and right arrow keys modify the current steering value a
little bit each frame.
Touch screen input uses the horizontal position of the player's finger on the screen
to generate the value; so it is -1 when the player is touching the left-hand side of the
screen and +1 when they are touching the right-hand side.
Finally, accelerometer input just scales the x axis accelerometer value into the
required range.
Summary
In this chapter, we've covered how to make our programs interactive by detecting
key and touch screen presses and by using the accelerometers of modern mobile
devices. We've also seen how we can build on the basic functionality provided in
order to detect swipe and pinch gestures.
In the next chapter, we'll be returning to things more graphical by showing how we
can use Marmalade to render 3D graphics in our games.
 
Search WWH ::




Custom Search