Permalink
Browse files

added better cooldown

  • Loading branch information...
1 parent 96bc06f commit befd59adb242b932ed3d216c6ebbe596e204e7aa @BlackScorp committed Feb 17, 2012
Showing with 9 additions and 5 deletions.
  1. +9 −5 assets/js/player.js
View
@@ -78,20 +78,24 @@ Crafty.c("Player",{
.bind("EnterFrame",function(frame){
if(frame.frame % this.weapon.firerate == 0){
- if(keyDown && !this.weapon.overheated)
+ if(keyDown && !this.weapon.overheated){
this.shoot();
+ }else{
+ if(this.heat.current > 0) //Cooldown the weapon
+ this.heat.current = Math.round(this.heat.current*29/30);
+ }
+
- if(this.heat.current > 0) //Cooldown the weapon
- this.heat.current--;
+
this.updateHeat();
- if(this.weapon.overheated && this.heat.percent < 75){
+ if(this.weapon.overheated && this.heat.percent < 85){
this.weapon.overheated = false;
this.infos.alert.hide();
}
- }
+ }
})
.bind("Killed",function(points){

0 comments on commit befd59a

Please sign in to comment.