p1nesap Posted May 6, 2014 Share Posted May 6, 2014 Would like to port my HTML5 arcade game which uses arrows for player navigation and space key to shoot, to Android via XDK. I had success with this basic demo, built .apk with XDK and installed on my 'Droid, showing the coordinates of a rectangle using touch. So that's a start. But how are you guys implementing player navigation and shooting? Is there a doc/tutorial? This dev has a controller library on github—that's all I'm finding. Thanks in advance for direction. Quote Link to comment Share on other sites More sharing options...
plicatibu Posted May 7, 2014 Share Posted May 7, 2014 You can use virtual controls to handle both movement and shooting.It's basically one sprite (or two) that will be used by the user to control the game.This approach is very common (my games ported from flash to Android use them).An alternative is to detect if user clicked at left/right/up/down side of your sprite and move it in that direction. For shooting a click over it should do the trick.Another alternative is to use accelerometer to move sprite and let user click in any place in the screen to shoot (except when clicking in a control like sound on/off). Quote Link to comment Share on other sites More sharing options...
p1nesap Posted May 7, 2014 Author Share Posted May 7, 2014 Thanks for replying plicatibu. So I make directional sprite to move player, and sprite button to shoot. Please link to code sample or tutorial how to implement touch with sprites, that control other sprites (not just move 1 sprite around with finger, which is all I know how to do at this point). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.