C
CJacobsSA
Guest
Hello. I'm making my first game with 8-direction controls and I'm trying to decide on a method of storing, calling, and using offsets for gun barrel position. I am aware of how to use lengthdir or manually specify an offset in a sidescroller or a top-down shooter for example, but there's a twist here that's making me scratch my head.The game is isometric, not top-down, so the gun's barrel is a different X and Y distance from the player's origin for each angle. For example:
The player moves in 8-directions but the gun aims in 16-directions for smoothness' sake. Each aim angle will need two integers to determine where (from the player's origin) the bullet should spawn at. This means, at minimum, 32 values for X and Y, repeated for every weapon in my game. My question is, what is the "best" way to store so many variables and recall them when a bullet is fired? And is there a simpler way to go about this?
The player moves in 8-directions but the gun aims in 16-directions for smoothness' sake. Each aim angle will need two integers to determine where (from the player's origin) the bullet should spawn at. This means, at minimum, 32 values for X and Y, repeated for every weapon in my game. My question is, what is the "best" way to store so many variables and recall them when a bullet is fired? And is there a simpler way to go about this?