I am trying to implement a twin stick shooter game, sometimes referred to as dual stick shooter where the left stick controls movement, and the right stick aims a gun.
What I do now, is directly map the stick angle to the gun angle, if the deflection is large enough. In pseudo code:
// jx in [-1,1]
// jy in [-1,1]
if lenght (jx,jy) > 0.5 :
gun_angle = toangle( jx, jy )
This gives a very unsmoothed, twitchy signal for the aim.
The gun can flicker in any direction in a single frame.
In theory, the most responsive scheme, but on-screen looks far too twitchy.
So I wonder: should I sacrifice some responsiveness for a smoother signal?
Should I make the gun swivel around as I reverse the direction of the joystick, or just set it hard, like I do now?
I've been considering using the stick signal as input to a PID controller that does the actual gun rotation, but would like to know whether that's an appropriate solution for this application.