Best way to implement mobile controls in a top down shooter

Get help using Construct 2

Post » Mon May 05, 2014 12:40 am

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
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Mon May 05, 2014 1:07 am

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.
Kurieus
Come visit and play Blast Box!
B
15
S
3
Posts: 205
Reputation: 1,349

Post » Mon May 05, 2014 2:36 am

mepis wrote: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
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Mon May 05, 2014 2:47 am

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.
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Mon May 05, 2014 11:29 am

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.
Kurieus
Come visit and play Blast Box!
B
15
S
3
Posts: 205
Reputation: 1,349

Post » Mon May 05, 2014 4:47 pm

mepis wrote: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 :)
B
20
S
4
Posts: 385
Reputation: 2,270


Return to How do I....?

Who is online

Users browsing this forum: KSLR and 38 guests