Top Down Twin Stick Shooter Controls

0 favourites
  • 7 posts
From the Asset Store
This is a twin stick shooter similar to Enter the gungeon,Nuclear Throne, Helldivers & Soul knight for the mobile device
  • Hey everyone

    I'm currently working on a Top Down Twin Stick Shooter. I want to move the player with the left stick and the direction of aiming with the right stick. It's pretty much the standard controls for top down shooters like "Enter the Gungeon".

    I already have implemented some controls which do work but they are not perfect. My controls are not very smooth. It seems like the movement is always locked in one direction, so moving in circles is not easy. This is the code I already have:

    dropbox.com/s/06m9ejv4ddyghxw/Gamepad_controls_screenshot.png

    Can someone tell me how to get a smoother version of these controls? It would be perfect if the controls would be as good as in "Enter the Gungeon".

  • You can do all this a bit easier:

    https://www.dropbox.com/s/fpfpwv7io4v6r ... .capx?dl=0

    Edit: oddly, it works perfectly in Firefox, however in Chrome the right X axis is always 0. Not sure why, maybe it's just my gamepad.

  • Hello maXimum7,

    here is another method without any behavior. Here you are able to move fast and slow.

    It is also advisable to not set the condition to 'axis </> 0' but to add some scope, so that the player is not moved unintentionally.

    Edit: New Screenshot. I forgot to include 'dt' for a framerate independent movement speed...

  • Thanks to both of you for your solutions.

    I've actually tested both of them and choosed the solution of dop2000

    kriand Your version of the viewing angle works in my project too. The player looks around smooth between the angles 0 to 180 and 180 to 360. The transition between these two states is not very smooth. The player keeps twitching while changing the viewing angle for wxample from 179 to 181.

  • . maXimum7

    i did not notice the jump between those angles. You can get rid of this if you set the condition to 'axis </> 0' (against my earlier advice... ).

    I did not notice any bugs, but on an older gamepad with a loose stick, it can cause unwanted rotation if the stick is not touched. (may never be the case in such a game)

    Since dop2000 uses a lerp function, I think its rotation is much smoother. With 'rotate toward angle' you can make it smoother, but not as smooth as with a lerp function. Maybe you can combine some things.

  • kriand

    I'll test a combination of your solution and the one of

    This definetly helped me out a lot

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • dop2000

    Hey!! I just tested this and it ONLY worked in Firefox but not Chrome.. WHY is that??

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