Best way to implement mobile controls in a top down shooter

0 favourites
  • 6 posts
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • What a title lol

    well... my game will have, basically, 7 controls:

    up (forward)

    down (backward)

    left

    right

    (also, preferably, diagonal movements too)

    shoot

    reload

    change weapon

    for the last 3, I'll do on-screen buttons, but what about the player movement?

    Thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I posted a thread on here about how to make dual joysticks for a game I'm making, something with similar needs to yours. I had a reply in that thread about doing it a different way.

    I ultimately liked my solution more because the joystick is created on touch and destroyed when the finger is released from the touch screen. For me, it solved a unique problem with touch screens. They don't have tactile feedback, they are all different sizes, and everyone has different sized hands. The way I did it, the neutral zone for the joystick is created and reset every time the player touches the touch screen. It also supports 8 way movement which is kind of what you want.

    The link to that thread is here: https://www.scirra.com/forum/viewtopic.php?f=147&t=103562

    I posted the same thing on my blog here: http://kurie.us/how-to-make-dual-joysticks-in-construct-2/

    Hopefully that'll give you an idea to work with. The thread here has two different solutions, mine and one that someone else posted.

    I will state that the solution I posted is for a layout size the same size as the window size. I had to modify that solution to work with a larger layout size. I have it working really nicely now and it's very responsive. I still have a bug to fix that if a lot of touches are placed extremely rapidly, it confuses it a bit. That should be easily fixed though, and for your solution, only needing one joystick, it should be non-existent (because of using buttons rather than a second joystick).

    Take a look, and if it interests you, I can post a modified version of my current game with a lot of stuff ripped out of it so you can see what I did with the two joysticks in a large layout.

    Hopefully that at least gives you a start and a few ideas to work with.

    Edit: to give you an idea of what I did for larger layouts, I ended up setting the control layer in a separate layer without parallax and pinning the control graphics to the touch pad object. That'll make a lot more sense if you look through the code I posted.

  • I posted a thread on here about how to make dual joysticks for a game I'm making, something with similar needs to yours. I had a reply in that thread about doing it a different way.

    I ultimately liked my solution more because the joystick is created on touch and destroyed when the finger is released from the touch screen. For me, it solved a unique problem with touch screens. They don't have tactile feedback, they are all different sizes, and everyone has different sized hands. The way I did it, the neutral zone for the joystick is created and reset every time the player touches the touch screen. It also supports 8 way movement which is kind of what you want.

    The link to that thread is here: https://www.scirra.com/forum/viewtopic.php?f=147&t=103562

    I posted the same thing on my blog here: http://kurie.us/how-to-make-dual-joysticks-in-construct-2/

    Hopefully that'll give you an idea to work with. The thread here has two different solutions, mine and one that someone else posted.

    I will state that the solution I posted is for a layout size the same size as the window size. I had to modify that solution to work with a larger layout size. I have it working really nicely now and it's very responsive. I still have a bug to fix that if a lot of touches are placed extremely rapidly, it confuses it a bit. That should be easily fixed though, and for your solution, only needing one joystick, it should be non-existent (because of using buttons rather than a second joystick).

    Take a look, and if it interests you, I can post a modified version of my current game with a lot of stuff ripped out of it so you can see what I did with the two joysticks in a large layout.

    Hopefully that at least gives you a start and a few ideas to work with.

    Edit: to give you an idea of what I did for larger layouts, I ended up setting the control layer in a separate layer without parallax and pinning the control graphics to the touch pad object. That'll make a lot more sense if you look through the code I posted.

    it's awesome, dude. thanks!

    but it has some bugs when i move the mouse quickly.. :/

    I found a tutorial with this result: studioryu.net/dev/touch_analog_tutorial

    I'll take a look

  • I forgot one thing... my game is a top down shooter.

    The player has to be able to move around AND AIM... so, two joysticks.

    I think there's no way to do it in mobile... because he still has to shoot.

  • You have to get creative with that, In my game, I initiated shooting whenever the rotation joystick is touched. It's difficult because you can only evver depend on two fingers being used at the same time on mobile. Anymore becomes cumbersome for the player.

    Sorry about the bugs. I have to update that post and my blog article. I fixed those bugs in my game.

  • You have to get creative with that, In my game, I initiated shooting whenever the rotation joystick is touched. It's difficult because you can only evver depend on two fingers being used at the same time on mobile. Anymore becomes cumbersome for the player.

    Sorry about the bugs. I have to update that post and my blog article. I fixed those bugs in my game.

    hehe thank you for the tips

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)