Page 1 of 1

"twin stick" shooting experiment

Posted: Fri May 03, 2024 9:04 pm
by desertfish
Modern game controllers usually have 2 analog sticks, which allows for a type of game called "twin stick shooter".
One stick is used to move around with, while the other is used to aim independently of the movement.

I made an experiment to kinda approach this control scheme on the X16.
It uses the mouse to do the aiming combined with WSAD keyboard controls to move around with across the horizontal and vertical axes.

Try It Now!


Personally, I think it's too awkward in this form. Maybe someone can come up with a better control scheme, another type of game that does match this better, or perhaps you can even get used to it?

Here's the source code in Prog8 : https://gist.github.com/irmen/cacd8d79d ... 5135fe413b

Re: "twin stick" shooting experiment

Posted: Fri May 03, 2024 10:09 pm
by DragWx
It's not awkward at all. In fact, I was certain keyboard movement + mouse aiming was a common control scheme for 2D shooting games, twin-stick or otherwise.

I know this is just for demonstration purposes, but you would definitely want to change the mouse cursor to something more see-through, like a targetting reticle or similar.

Re: "twin stick" shooting experiment

Posted: Sat May 04, 2024 12:56 am
by Edmond D
desertfish wrote: Fri May 03, 2024 9:04 pm
Personally, I think it's too awkward in this form. Maybe someone can come up with a better control scheme, another type of game that does match this better, or perhaps you can even get used to it?
It does seem to be a little awkward to me. I'd probably get use to it if there was an enjoyable game with targets to hit, rather than just a proof of concept.

In a real tank there is a driver and a gunner, two people. Perhaps whatever is developed becomes a two player game where they work together to destroy the enemy. One player uses the mouse/gamepad and the other uses the keyboard or another gamepad.

I could see if the mouse was used in a mode where moving the mouse sets the direction of the tank. The distance of the pointer to the tank might control the speed. Clicking and holding the left button swings the turret (tank rolls to a stop perhaps), and a right click launches the round.

A simpler mode would be a left click as move to the pointer and a right click to fire to the pointer.

I did see that the shell goes to the mouse pointers direction and position, so if the pointer is over the barrel then one never sees the round.

Re: "twin stick" shooting experiment

Posted: Wed May 08, 2024 7:42 pm
by mortarm
I played a ton of FPSs back in the day, and I always used a mouse+KB, so it felt pretty natural to me. And just for S&G, I tried going diagonal using key combos like WD, AS, etc., and it worked while still aiming the turret independently.

Re: "twin stick" shooting experiment

Posted: Sun May 12, 2024 9:49 pm
by desertfish
Weird, how could you go diagonally? On my system if I press 2 keys at the same time, only 1 of them starts repeating so I get for example W+D: wdddddddddddddddddddddd

Re: "twin stick" shooting experiment

Posted: Mon May 13, 2024 1:18 am
by DragWx
I imagine the actual game engine would use key-down and key-up events instead of character input events, which would allow diagonals.