Hey all!
I'm trying to make a character able to fire three different types of bullets depending on how long they hold the space button down.
I have a "Player" sprite with a "Charging" numeric instance variable and a "Charge" sprite with animations "Idle", "Charging1", "Charging2", and "Charging3".
What I have right now is:
| Keyboard - Space is down . . . . | Charge - Set animation to "Charging1"
| Player - Charging = 0 . . . . . . . . | Player - Set Charging to 1
| | . . . . . . . . . . . . . . . . . . . . . . . . . |System - Wait 2.5 seconds
| |
| | Keyboard - Space is down . . | Charge - Set animation to "Charging2"
| | Player - Charging = 1 . . . . . . . | Player - Set Charging to 2
| | | . . . . . . . . . . . . . . . . . . . . . . . . | System - Wait 3.5 seconds
| | |
| | | Keyboard - Space is down . . . | Charge - Set animation to "Charging3"
| | | Player - Charging = 2 . . . . . . . .| Player - Set Charging to 3
Also, above that, I have:
| Keyboard - On Space released . . . . | Player - Set Charging to 0.
This works in that when the player holds down the Space bar, the Charge sprite goes through the proper animations at the pace I want, but if the player quickly presses space repeatedly for a bit before holding the space button, the Charge sprite animation jumps straight to "Charging2" and doesn't change after.
I know that's because the events have the System Wait postponements in them, and I'm having a bit of trouble trying to make it work.
Can anyone help me with this?
Thanks!
Scott