Spacedoubt, 'z 'was there as a placeholder, 'x' is the one I was actually working on. I know it looks complicated, but I'd like to walk you through the process a bit, my plan was to:
when x is pressed and a bullet's boolean value of ready is set to true
spawn a bullet
set the angle of that bullet to a value corresponding to the pressed arrow keys (8 directions)
Then set "Ready" to false signifying that the gun has been fired and can't be re-fired yet
wait for a "reload time" that is set within the portal bullet
and finally set ready to true signifying a new bullet can be pressed.
Because I was intending for 8 directional shooting, not 2 directional shooting, I need something a bit more complex than simply looking at the direction the shooter is facing. (Further, the most glaring problem was that I was setting the bullet's angle rather than the angle of motion.)
Lof, the fix works great! I can see you took the time to not only fix it but also use better programming practices. I really appreciate the effort you clearly put in. I would love it if we could talk about it a bit though.
I see that you gave the shooter a "fireAngle" attribute that holds the direction that he's currently firing, Then you simplify it by having the shooting and the setting of the angle as two different steps, that way we can reduce a lot of repeated code, I really like the more modular approach.
The only problem is, I was hoping to use the reload time to limit the rate at which the player can fire (I only set it to 3 seconds to exaggerate it for testing, in the real game it will be a much shorter time). The player can get around this pre-imposed limit simply by mashing the 'x' button. How could I change it so that the player is unable to shoot for a specified amount of time after each shot? Similarly, is there a way I can limit the number of bullets that can exist onscreen at a given time... i.e. The bullets are destroyed offscreen (I know that can be set in behaviors) and while there are 3 or more on screen, the player can't shoot.