8-way directional shooting (like Super Metroid)?

Hey Everyone,

I’m trying to make a game with similar functionality to Super Metroid. In Super Metroid, Samus can shoot in 8 directions: left, right, 4 diagonals, and up and down. How could I get this to work, or even 360-degree shooting? Just to clarify, the game is entirely 2-D. Thanks!

Hi man,
You are planning to use keyboard? mouse? or mobile pad?
All these things work different and you have to be clever,

At this link you can find a whole question about making a shooter 2D to the mouse 2D Shooter BP Problem Shooting at location - Blueprint Visual Scripting - Unreal Engine Forums

If you are not planning to use the mouse , but only the pad for example,
you just get the input of your pad to understand where to aim, Up, Up-Right- right
these info can be converted in simple vectors or 2coordinates (0,1) or (1,1) (-1,0)…
Using this you can spawn your bullet in the direction and surely change your player character to a speciic sprite, (or rotate the player if you are not using sprites/flipboook)

Thanks for the response and sorry for the late reply.

The game will be using keyboard + mouse. For aiming, I will likely have players use a mouse. Something like a PS4/360 controller will be usable. The thing is, I figure if a mouse is going to be used, it the game should probably be able to detect 360 degrees of rotation. So I’m guessing I just need to track the mouse location and rotate the arm/gun based on this.

Thanks for the link. I’ll be sure to check it out.

… the insinuation that because of a different input device a circle is not composed of 2PI radians is just plain asinine.

Input methods have no relationship whatsoever with the amount of degrees you rotate something.

ergo, just make it so that your vector for shooting is rotated by a set amount.
And remember that you have the forward, right, and Up vector you can base the starting calculations on.

In your case, with only 8 directions you have an increment of 360/8 - or 45°.

In the case of gaining input data form the mouse, the situation is no different. You still increment and decrement a rotation value based on the current mouse position. You don’t need anything fancy, just to know if you are before/after the previous frame.

Hi man,
Yep, sorry , my bad, i could be more clear,
Since he wrote "can shoot in 8 directions… " and "How could I get this to work, or even 360-degree shooting? "
i focused on the mechanical part of input , before the vector set up .