O'Reilly logo

Marmalade SDK Mobile Game Development Essentials by Sean Scaplehorn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. User Input

A video game is not going to be a whole lot of fun to play if the user has no way of controlling the events that happen, so in this chapter we will be looking at the various ways in which we can add interactivity to our programs by using Marmalade. By the end of this chapter you will know how to detect the following types of input:

  • Key presses
  • Touch screen and pointer inputs
  • Detection of gestures such as swipes and pinches
  • Changes in device orientation using accelerometers

Detecting key input

We'll start our journey into the world of player input methods with the simplest method possible—pressing keys, which we detect by using the s3eKeyboard API. To use these functions in our code, we just need to include the s3eKeyboard.h file. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required