Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating a 2d platformer game like Super Meat Boy in which precision of movement of my lead character matters. I am using libgdx. The keyboard controls on the PC work precisely, but when it comes to accelerometer handling, it's really hard to handle the character precisely. This worsens in stages with congested safe paths to escape. I thought of implementing an on-screen analog ball for handling input, but read a lot of bad consequences of that on the internet.

What is an intuitive but precise input method to use for platformer games on touch devices?

share|improve this question
up vote 6 down vote accepted

In a word: Swiping.

I played Pac-Man championship edition on my Android phone and what I thought really worked for it is that while there was an on screen joystick, you didn't actually have to touch it to move Pac-Man in the proper direction. If your finger fell off the joystick it didn't matter. All that mattered is in what direction you moved your finger.

To move up, swipe up. To move down, swipe down. To move left, swipe left. To move right, swipe right.

You could just as easily make swiping context sensitive to screen regions and actions currently happening within the game. Imagine your phone is in landscape mode and you are holding it like a video game controller. The left half of the screen could be reserved for movement using the swiping I describe above. The right half of the screen could be used for actions such as jumping, shooting, shielding, whatever game play abilities you want to give your player using swiping in a very similar fashion. Or if you only have one ability (like jumping in Super Meat Boy) - just treat the right half of the screen as a button.


We were discussing this in chat and it appeared that my solution, the way its described above is a lot like a virtual stick that moves when you lift up and place down your finger. I want to elaborate that this is not the case and is actually much more flexible than that.

Pacman Swiping

The image above shows the swiping pattern one could take to move Pacman around on the board. Note that the action that is taken is not at all based on where you place your finger down the first time. If you accidentally move your finger too far when swiping right or not enough when swiping down, its ok. With this implementation as long as you swiped far enough for it to register properly with the software it will take it and use where your finger ended up as the next starting point, or if you lift your finger off, it will use the next place you put your finger down.

As I said before, you could apply this to a platformer just by splitting controls into separate regions so that that your swipes and taps do different things depending on where on the screen you performed the action. The obvious route is make the left side handle movement just using swiping. Then the right side would be used to handle actions and abilities of the player using any combination of swipes and taps.

share|improve this answer

What if you treated a half of the screen like a virtual track ball where the position/speed of your character is directly tied to that of the ball? Swiping and releasing would set your character into constant motion (and cause the trackball to spin). Holding your finger on the screen would be like holding the trackball so that you could make small adjustments to your character's position, or stop your character from moving. I think this could work quite well for those frantic moments in Super Meat Boy where you're trying to run, jump, then stop on a dime. This would be an experimental approach because I haven't seen it done before, but anything is better than a virtual stick.

share|improve this answer
I actually really like this answer as it's kind of thinking outside the box. If anyone implements it I would be very curious as to how well it actually works. – SpartanDonut Jan 10 '13 at 21:00

I found side-of-screen touch and hold controls to be the most responsive.

If the person touches the left side, run left (until he lets go). If the person touches the right side, run right.

RunRunRiot! is an example of this.

As for jumping, you could go for a mid-screen tap (using either hand).

Examples (landscaped iPad) Running right

|            |
|            |
|            |

Jumping right

|            |
|L*          |
|            |

(L* = left tap)

Jumping left

|            |
|          R*|
|            |
share|improve this answer

The best input for a touch screen game I have found is on those really simple platform games when all you have to do is touch the screen to jump! Any game that uses the accelerometer for movement input to me is very disorienting!

This is a common dilemma when developing on a touch screen, if only there was a D-pad attachment that was popular. I think you will have to try your on screen ball idea.

Maybe you could have the left and right input on the far left and far right of the screen and have the up and down using the the higher or lower part of the left or right input. I think that makes sense?

share|improve this answer

You could consider having more precise controls for only when the player character is airborne.

For instance, if the right side of the screen controlled lateral direction, you could have the entirety of the left side be for the jump. Once airborne, the bottom left half of the screen could be 'descend' and the top half could be double jump.

Another option would be to adopt a jumping scheme like Jetpack Joyride or those "Cave" type games, where the longer you hold "up" the higher you go. It has the potential to be fairly precise and I think would work well with a Super Meat Boy type platformer, assuming the levels are designed appropriately.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.