Cooldown System

Rapid fire looks fun and dandy, until it makes your game too easy
Cooldown script (fig.1)
Cooldown script (fig.2)

When the keycode “space” is pushed, check the real time to see if we can fire. We can only fire when the bullet has left the player after a certain set time. Therefore _canFire = the real time + _fireRate.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store