Cool-Down!

Andrew Lengen
Mar 26, 2021
Cool-down variables

I decided that we needed to remedy our fast-shooty boy with a small cool-down between keypresses; variables are listed above.

So I needed to calculate how much time had passed and make sure it was greater than the fire rate variable, then I needed to set the cooldown so there is a 0.05 second pause.

Now there is a nice little delay despite mashing my keyboard!

I’m thinking maybe I’ll add an ammo count and a reload time after a certain amount of fired lasers since we’re already here. I’ll play around and see what I can do.

--

--

Andrew Lengen

If ambition and practicality amalgamated, it would be me! I am here to climb the mountains of my ambition and catalog my journey so that someone can be changed!