Greeting Construct 2 users,
I have included codes in my Event Sheet that allows the player to shoot automatically while he or she is dragging the spaceship (the sprite that represents the player). But unfortunately, the spaceship is shooting too many laser rays at once. What kind of code and variable can I add to the current code in my event sheet, so the spaceship can shoot a reasonable number of laser rays? Here's a picture of the code in my event sheet:
in event 6, just add some time to ShootSpaceship.
if you want the spaceship to shoot 10 times a second, set ShootSpaceship to 0.1
for 5 times per second, set ShootSpaceship to 0.2
for 3 times per second, 0.33
twice a second, 0.5
Develop games in your browser. Powerful, performant & highly capable.
To AllanR:
Thank you for the solution that you have suggested to me, it works!