Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added better cooldown

  • Loading branch information...
commit befd59adb242b932ed3d216c6ebbe596e204e7aa 1 parent 96bc06f
@BlackScorp authored
Showing with 9 additions and 5 deletions.
  1. +9 −5 assets/js/player.js
View
14 assets/js/player.js
@@ -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){
Please sign in to comment.
Something went wrong with that request. Please try again.