Overheating gun

I am just looking for ideas here.

I am working on a gun that can overheat if over fired (thereby forcing the player to wait for a cool down to be able to use it again), and I have tried it from several angles but haven’t been really happy with any method so far.

I’m just checking to see if anyone else out there had given this type of thing some thought ever, and if so would be willing to share some ideas.

Thanks! [import]uid: 102017 topic_id: 18848 reply_id: 318848[/import]

have a gun, spawn bullets from it to table, check for length of table in separate function or whatever, if # of table exceeds some amount then run another function that will change sprites for gun or something and activate timer for it to cool down
i would do it like that i think, its just right out of my mind [import]uid: 16142 topic_id: 18848 reply_id: 72560[/import]

You could easily use a variable that would hold the current HEAT amount.
Everytime you shoot a bullet, this variable is increased. When this variable reaches a specific count, change the sprite or do whatever you want to show that the gun is overheating.
Disable the gun, activate a timer that will reactivate it after a specific delay.

Also, If you want the gun to COOL DOWN when NOT shooting even if its not overheating, you could set a timer that will decrease the HEAT value by a specific amount when you are not shooting.

This timer could be created when you stop shooting, and canceled when you start shooting…depending on the desired behavior.

Hope this helps. [import]uid: 69375 topic_id: 18848 reply_id: 72569[/import]

Kaveng’s advice sounds like the way to go [import]uid: 84637 topic_id: 18848 reply_id: 72975[/import]

i would have a counter for the bullets. every shot would decrease the number of rounds(bullets),
I would also have another counter to count during a set amount of time after which the gun would heat up. I would also change the gun from dynamic to static at this point. That way it actually freezes up. Have another timer start at this point(call it the STATE of the GUN) which equals “OVERHEATED”. Then after that timer completes it reverts to “NORMAL” firing mode.
I would also have other STATES(EMPTY,NORMAL,OVERHEATED,SNIPER,BURST). That way you can incorporate different MODES of you gun allowing for rapid fire, extended range, etc…
Just my opinion… [import]uid: 11094 topic_id: 18848 reply_id: 72995[/import]

All of these responses have been very helpful, and different enough from what I had been trying to help me along.

Thanks! [import]uid: 102017 topic_id: 18848 reply_id: 73001[/import]