Dodonpachi style shooting behavior

0 favourites
  • 4 posts
From the Asset Store
Shoot balls to destroy as many blocks as possible, at each stage the game will become more difficult.
  • Hi everyone!

    Ok I have a problem with my shooting mechanic. I don't use "every x seconds" for shooting because it's really innacurate because of the way the time lapses, so I usually make my machine guns with:

    Which works perfectly well, but with this code, if I stop pressing my button (ShootSmall goes from 1 to 0) and press it again, no bullet will come out until the waiting time passes and CanShoot variable allows that.

    So I want to make that when I stop pressing the button, all the waiting thing resets and it inmediatly shoots so the player can spam the shoot button if he thinks he is faster than the auto-shooting.

    I hope I explained my self well enough.

    Thanks!

  • I think I get what you mean. You want auto-fire, but you also want the player to be able to manually rapid fire faster than the preset, right?

    What you could do is fire a shot when the button is pressed, and as long as that button is held, run a Timer behavior on an interval. Every time the Timer finishes, fire another shot. And when the player releases the button, stop the Timer.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Wow, very interesting solution using a timer. I'll get it a shot, thanks so much!

    Edit: It works great! Totally forgot about that behaviour :) Thanks again.

  • No problem, DDP is one of my favorite shooters next to thunder force 3 and giga wing. Good luck on the game!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)