6
\$\begingroup\$

How action game controls should be implemented so that they would work on smart phones as well?

At the moment I use wasd/arrow keys and I am able to handle for example two keys down at the same time.

But many phones has no physical keyboard so should I render some control areas? Are there any JS libraries for this?

\$\endgroup\$
1
\$\begingroup\$

The Akihabara framework provides special input areas for games when they run on multitouch-devices.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

One way to go is to render on screen controls for mobile/touch devices. However, I feel like this isn't the best approach. In order to have the best possible experience for your game it should respond to touch events within the game itself. (Touch a unit to select it, touch & drag an item from slot to slot, etc)

Take Plants vs Zombies on iPad for example. One of the reasons why it's such a great game on that platform is that the gameplay itself meshes well with touch controls.

On screen controls are definitely the "easy way out" when trying to port your game to mobile touch environments but they feel clunky and probably won't give your users the best experience with your game.

Some games just aren't meant for touch interfaces and if a developer wants to support mobile/touch they're better off designing their game to accept that style of input from the start.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Yes, it's certainly better to design the game for multi-touch. But the OP was asking about a Javascript (HTML5 Browser-Game) implementation that would also work on Smartphones/iPad. \$\endgroup\$ – bummzack Nov 3 '10 at 7:58
1
\$\begingroup\$

Take a good look at the Hammer framework, it's great:

http://eightmedia.github.io/hammer.js/

Here's a good an on-screen controller framework that looks pretty good too:

https://github.com/austinhallock/html5-virtual-game-controller

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Welcome to GD.SE! This looks like a great answer, but the question is over 2 years old. Perhaps you could try answering some of the newer questions. \$\endgroup\$ – Polar Nov 30 '13 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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