Browse code

fix fire rate bug

devnewton authored on 16/10/2016 at 20:57:21
Showing 4 changed files
... ...
@@ -14,6 +14,8 @@ export class Bullet extends Phaser.Sprite {
14 14
         this.checkWorldBounds = true;
15 15
         this.outOfBoundsKill = true;
16 16
         this.exists = false;
17
+        this.health = 0;
18
+        this.alive = false;
17 19
     }
18 20
 
19 21
     fire(fromX: number, fromY: number, angle: number, speed: number, gravityX: number, gravityY: number) {
... ...
@@ -25,6 +25,5 @@ export class MachineGun extends Phaser.Group {
25 25
                 bullet.fire(fromX, fromY, angle, this.bulletSpeed, 0, 0);
26 26
                 this.nextFireTime = this.game.time.time + this.fireRate;
27 27
             }
28
-        }
29 28
     }
30 29
 }
31 30
\ No newline at end of file
... ...
@@ -91,7 +91,6 @@ export class Level extends AbstractState {
91 91
 
92 92
     update() {
93 93
         this.pathfinder.update();
94
-        this.hero.update();
95 94
         this.game.physics.arcade.collide(this.hero, this.collisionSprites);
96 95
         this.resolveWeaponsEffects();
97 96
     }
... ...
@@ -1,17 +1,17 @@
1 1
 {
2
-  "name": "shmuprpg",
3
-  "version": "0.1.0",
4
-  "description": "shmuprpg",
5
-  "scripts": {
6
-    "start": "brunch watch --server",
7
-    "prod": "brunch build --production"
8
-  },
9
-  "devDependencies": {
10
-    "auto-reload-brunch": "^2.7.1",
11
-    "brunch": "^2.8.2",
12
-    "brunch-typescript": "1.8.1"
13
-  },
14
-  "dependencies": {
15
-    "easystarjs": "0.3.0"
16
-  }
2
+    "name": "shmuprpg",
3
+    "version": "0.1.0",
4
+    "description": "shmuprpg",
5
+    "scripts": {
6
+        "start": "brunch watch --server",
7
+        "prod": "brunch build --production"
8
+    },
9
+    "devDependencies": {
10
+        "auto-reload-brunch": "^2.7.1",
11
+        "brunch": "^2.8.2",
12
+        "brunch-typescript": "1.8.1"
13
+    },
14
+    "dependencies": {
15
+        "easystarjs": "0.3.0"
16
+    }
17 17
 }