Browse code

adjust difficulty

devnewton authored on 23/10/2016 at 08:56:39
Showing 3 changed files
... ...
@@ -32,7 +32,7 @@ export class Grobelin extends Phaser.Sprite {
32 32
         const beforeGrobelinAnimation = beforeGrobelin.animations.add('appears');
33 33
         beforeGrobelinAnimation.onComplete.add(() => {
34 34
             beforeGrobelin.destroy();
35
-            this.reset(fromX, fromY, 30);
35
+            this.reset(fromX, fromY, 20);
36 36
             this.body.setSize(16, 16, 24, 48);
37 37
             this.body.collideWorldBounds = true;
38 38
             this.blackboard = new GrobelinBlackboard();
... ...
@@ -20,6 +20,7 @@ export class SpiderHorde extends Phaser.Group {
20 20
 
21 21
     reset(target: Phaser.Sprite, maxSpiders: number = 4) {
22 22
         this.target = target;
23
+        this.removeAll();
23 24
         for (let i = 0; i < maxSpiders; ++i) {
24 25
             this.add(this.createSpider());
25 26
         }
... ...
@@ -90,11 +90,11 @@ export class Level extends AbstractState {
90 90
         this.game.time.events.add(20 * 1000, () => this.spiderHorde.reset(this.hero, 4));
91 91
         this.game.time.events.add(40 * 1000, () => this.birdFlock.reset(this.hero, 10));
92 92
         this.game.time.events.add(60 * 1000, () => {
93
-            this.birdFlock.reset(this.hero, 0);
94
-            this.spiderHorde.reset(this.hero, 0);
95
-            this.grobelinHorde.reset(this.hero, 0)
93
+            this.birdFlock.flyRate = Number.MAX_VALUE;
94
+            this.spiderHorde.appearsRate = Number.MAX_VALUE;
95
+            this.grobelinHorde.appearsRate = Number.MAX_VALUE;
96 96
         });
97
-        this.game.time.events.add(70 * 1000, () => {
97
+        this.game.time.events.add(80 * 1000, () => {
98 98
             for (let i = 0; i < 4; ++i) {
99 99
                 let pos = this.pathfinder.randomWalkablePos();
100 100
                 let bunny = new Bunny(this.game, this.pathfinder);