Touch Screen Controls for Topdown Shooter

Hello everyone, I am a beginner trying to build a top-down shooter and have been making extensive use of the Defold Public Examples resource.

the basic controls of the game i am trying to build are essentially the same as Rotate and Move from the examples. In summary, W and S move the character forward and backward, while A and D rotates the character left and right. Mouse movement is not enabled in the game because gradual rotation is part of the challenge of the game.

After I got that running, I tried to build a touch interface for the game’s HTML5 form. I first tried a single on-screen joystick control (left and right directions to rotate, up and down to go forward and backward) and implemented it using the excellent VirtualGamepad example and the associated britzl/defold-input library.

Unfortunately, I found the controls to be unintuitive. I am now trying to do a dual joystick setup (left joy stick dedicated to forward and backward, right joystick for rotate left and right, but when I tried to duplicate the virtual gamepad setup, I found that I could only control one joystick at once!

As such I have 2 questions I would like to ask the veterans on this forum

  1. What do I need to do so that I can use the defold-input library in a way that utilises multiple touches on the screen at once

and

  1. If anyone knows any other good way to do top-down shooter touchscreen controls?

Thanks so much in advance for the help!

Yes, sure you can use multi touch with virtual controller. You need to add a multi-touch input binding.

oh gosh, it works. thank you! such a stupid mistake on hindsight..

1 Like