I'm trying to prototype a top-down shoot-em-up in game maker, but I've run into a critical flaw early on. I'm having trouble making instances of the player's bullet appear during the step event for the player object.
I have the prototype set up to where the player object moves towards the mouse. Whenever the player clicks the left mouse button, two instances of the bullet object should appear and shoot forward. If the player holds down the left mouse button, bullets should continuously appear. I've gotten the bullet instances to appear and shoot forward, and if the player holds down the left mouse button they continually spawn. However, the instances of the bullet object only seems to appear when the player is moving backwards.
What I have tried:
- Disabling the fixed direction of the bullet object
The bullets still only appeared when the player object is moving backwards, only this time they flew to the right
- Changed code in step event to Drag and Drop "Jump to point"
The bullets still only moved when the ship was going backwards.
- Assigned a smaller variable to the bullet cooldown variable in the step event
I thought maybe I was just making the bullets spawn too slow, but again, they only spawned when the player object was moving backwards.
Attached is a few screenshots of my code, most of which is done in drag-n-drop. Help would be greatly appreciated.
Step event for the player object
Create event for the player object