Browse code

update shmuprpg

devnewton authored on 04/11/2016 17:04:15
Showing 33 changed files
... ...
@@ -1 +1 @@
1
-Place your app source files here.
1
+play.bci.im sources
2 2
\ No newline at end of file
... ...
@@ -152,14 +152,18 @@ require.register("ShmuprpgApp.ts", function(exports, require, module) {
152 152
 "use strict";
153 153
 const ShmuprpgGame_ts_1 = require("./ShmuprpgGame.ts");
154 154
 new ShmuprpgGame_ts_1.ShmuprpgGame();
155
-
156
-
155
+//# sourceMappingURL=ShmuprpgApp.js.map
157 156
 });
158 157
 
159 158
 require.register("ShmuprpgGame.ts", function(exports, require, module) {
160 159
 "use strict";
161 160
 const Intro_ts_1 = require("./states/Intro.ts");
162 161
 const Title_ts_1 = require("./states/Title.ts");
162
+const DemoEnding_ts_1 = require("./states/DemoEnding.ts");
163
+const Help_ts_1 = require("./states/Help.ts");
164
+const Options_ts_1 = require("./states/Options.ts");
165
+const KeyboardOptions_ts_1 = require("./states/KeyboardOptions.ts");
166
+const GamepadOptions_ts_1 = require("./states/GamepadOptions.ts");
163 167
 const Level_ts_1 = require("./states/Level.ts");
164 168
 const GameOver_ts_1 = require("./states/GameOver.ts");
165 169
 const Controls_ts_1 = require("./utils/Controls.ts");
... ...
@@ -171,8 +175,13 @@ class ShmuprpgGame extends Phaser.Game {
171 175
         });
172 176
         this.state.add('Intro', Intro_ts_1.Intro);
173 177
         this.state.add('Title', Title_ts_1.Title);
178
+        this.state.add('Help', Help_ts_1.Help);
179
+        this.state.add('Options', Options_ts_1.Options);
180
+        this.state.add('KeyboardOptions', KeyboardOptions_ts_1.KeyboardOptions);
181
+        this.state.add('GamepadOptions', GamepadOptions_ts_1.GamepadOptions);
174 182
         this.state.add('Level', Level_ts_1.Level);
175 183
         this.state.add('GameOver', GameOver_ts_1.GameOver);
184
+        this.state.add('DemoEnding', DemoEnding_ts_1.DemoEnding);
176 185
     }
177 186
     preloadGame() {
178 187
         this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
... ...
@@ -182,7 +191,7 @@ class ShmuprpgGame extends Phaser.Game {
182 191
     }
183 192
     createGame() {
184 193
         this.controls = new Controls_ts_1.Controls(this);
185
-        this.state.start('Level');
194
+        this.state.start('Title');
186 195
     }
187 196
     addSpriteAnimation(sprite, animationName, frameCount) {
188 197
         return sprite.animations.add(animationName, this.genAnimArray(animationName, frameCount));
... ...
@@ -196,11 +205,10 @@ class ShmuprpgGame extends Phaser.Game {
196 205
     }
197 206
 }
198 207
 exports.ShmuprpgGame = ShmuprpgGame;
199
-
200
-
208
+//# sourceMappingURL=ShmuprpgGame.js.map
201 209
 });
202 210
 
203
-require.register("entities/Bird.ts", function(exports, require, module) {
211
+;require.register("entities/Bird.ts", function(exports, require, module) {
204 212
 "use strict";
205 213
 class Bird extends Phaser.Sprite {
206 214
     constructor(game) {
... ...
@@ -238,11 +246,10 @@ class Bird extends Phaser.Sprite {
238 246
     }
239 247
 }
240 248
 exports.Bird = Bird;
241
-
242
-
249
+//# sourceMappingURL=Bird.js.map
243 250
 });
244 251
 
245
-require.register("entities/BirdFlock.ts", function(exports, require, module) {
252
+;require.register("entities/BirdFlock.ts", function(exports, require, module) {
246 253
 "use strict";
247 254
 const Bird_ts_1 = require("./Bird.ts");
248 255
 class BirdFlock extends Phaser.Group {
... ...
@@ -250,7 +257,11 @@ class BirdFlock extends Phaser.Group {
250 257
         super(target.game);
251 258
         this.flyRate = 1000;
252 259
         this.nextFlyTime = 0;
260
+        this.reset(target, maxBirds);
261
+    }
262
+    reset(target, maxBirds = 10) {
253 263
         this.target = target;
264
+        this.removeAll();
254 265
         for (let i = 0; i < maxBirds; ++i) {
255 266
             this.add(this.createBird());
256 267
         }
... ...
@@ -281,21 +292,23 @@ class BirdFlock extends Phaser.Group {
281 292
     }
282 293
 }
283 294
 exports.BirdFlock = BirdFlock;
284
-
285
-
295
+//# sourceMappingURL=BirdFlock.js.map
286 296
 });
287 297
 
288
-require.register("entities/Bullet.ts", function(exports, require, module) {
298
+;require.register("entities/Bullet.ts", function(exports, require, module) {
289 299
 "use strict";
290 300
 class Bullet extends Phaser.Sprite {
291
-    constructor(game) {
292
-        super(game, 0, 0, 'bullets');
293
-        game.addSpriteAnimation(this, 'bullet.red', 4);
301
+    constructor(game, animation = 'bullet.red', atlas = 'bullets') {
302
+        super(game, 0, 0, atlas);
303
+        this.bulletAnimation = animation;
304
+        game.addSpriteAnimation(this, this.bulletAnimation, 4);
294 305
         this.game.physics.enable(this, Phaser.Physics.ARCADE);
295 306
         this.anchor.setTo(0.5, 0.5);
296 307
         this.checkWorldBounds = true;
297 308
         this.outOfBoundsKill = true;
298 309
         this.exists = false;
310
+        this.health = 0;
311
+        this.alive = false;
299 312
     }
300 313
     fire(fromX, fromY, angle, speed, gravityX, gravityY) {
301 314
         this.reset(fromX, fromY, 1);
... ...
@@ -303,15 +316,238 @@ class Bullet extends Phaser.Sprite {
303 316
         this.game.physics.arcade.velocityFromRotation(angle, speed, this.body.velocity);
304 317
         this.angle = angle;
305 318
         this.body.gravity.set(gravityX, gravityY);
306
-        this.play('bullet.red', 4, true);
319
+        this.play(this.bulletAnimation, 4, true);
307 320
     }
308 321
 }
309 322
 exports.Bullet = Bullet;
323
+//# sourceMappingURL=Bullet.js.map
324
+});
310 325
 
326
+;require.register("entities/Bunny.ts", function(exports, require, module) {
327
+"use strict";
328
+const CircularGun_ts_1 = require("./CircularGun.ts");
329
+const b3 = require("../ia/decisions/b3.ts");
330
+class Bunny extends Phaser.Sprite {
331
+    constructor(game, pathfinder) {
332
+        super(game, 0, 0, 'bunny');
333
+        this.pathfinder = pathfinder;
334
+        this.game.physics.enable(this, Phaser.Physics.ARCADE);
335
+        this.anchor.setTo(0.5, 0.5);
336
+        this.checkWorldBounds = true;
337
+        this.outOfBoundsKill = true;
338
+        this.exists = false;
339
+        this.game.addSpriteAnimation(this, 'bunny.walk.front', 7);
340
+        this.game.addSpriteAnimation(this, 'bunny.walk.back', 7);
341
+        this.game.addSpriteAnimation(this, 'bunny.walk.right', 7);
342
+        this.game.addSpriteAnimation(this, 'bunny.walk.left', 7);
343
+        this.game.addSpriteAnimation(this, 'bunny.stand.front', 1);
344
+        this.game.addSpriteAnimation(this, 'bunny.stand.back', 1);
345
+        this.game.addSpriteAnimation(this, 'bunny.stand.right', 1);
346
+        this.game.addSpriteAnimation(this, 'bunny.stand.left', 1);
347
+        this.birdExplosion = this.game.add.sprite(this.x, this.y, 'bird-explosion');
348
+        this.birdExplosion.anchor.setTo(0.5, 0.5);
349
+        this.birdExplosion.exists = false;
350
+        const explodeAnimation = this.birdExplosion.animations.add('explode');
351
+        explodeAnimation.killOnComplete = true;
352
+        this.weapon = new CircularGun_ts_1.CircularGun(this.game);
353
+    }
354
+    static preload(game) {
355
+        game.load.atlasXML('bunny', 'sprites/lpc/bunny/bunny.png', 'sprites/lpc/bunny/bunny.xml');
356
+    }
357
+    appears(fromX, fromY) {
358
+        const beforeBunny = this.game.add.sprite(fromX, fromY, 'before-bird');
359
+        beforeBunny.anchor.setTo(0.5, 0.5);
360
+        const beforeBunnyAnimation = beforeBunny.animations.add('appears');
361
+        beforeBunnyAnimation.onComplete.add(() => {
362
+            beforeBunny.destroy();
363
+            this.reset(fromX, fromY, 10);
364
+            this.blackboard = new BunnyBlackboard();
365
+        });
366
+        beforeBunnyAnimation.play(4, false);
367
+    }
368
+    update() {
369
+        super.update();
370
+        if (this.exists) {
371
+            this.executeBehaviorTree();
372
+        }
373
+    }
374
+    executeBehaviorTree() {
375
+        BunnyB3.get().tick(this, this.blackboard);
376
+    }
377
+    damage(amount) {
378
+        super.damage(amount);
379
+        if (!this.damageTween) {
380
+            this.damageTween = this.game.add.tween(this).from({ tint: 0xFF0000 }).to({ tint: 0xFFFFFF }, 500, Phaser.Easing.Linear.None, true, 0, 4, false);
381
+            this.damageTween.onComplete.add(() => this.damageTween = null);
382
+        }
383
+        this.blackboard.fearLevel = 60;
384
+        return this;
385
+    }
386
+    kill() {
387
+        super.kill();
388
+        if (this.damageTween) {
389
+            this.damageTween.stop(true);
390
+        }
391
+        this.birdExplosion.reset(this.x, this.y);
392
+        this.birdExplosion.play('explode', 8, false);
393
+        return this;
394
+    }
395
+}
396
+exports.Bunny = Bunny;
397
+class BunnyBlackboard extends b3.Blackboard {
398
+    constructor(...args) {
399
+        super(...args);
400
+        this.fearLevel = 60;
401
+    }
402
+}
403
+class BunnyB3 extends b3.Tree {
404
+    constructor() {
405
+        super();
406
+        this.root = this.selector(new ActionFollowPath(), this.sequence(new ConditionFeelSafe(), new ActionAttack()), new ActionSearchAPath());
407
+    }
408
+    static get() {
409
+        return this.singleton || (this.singleton = new BunnyB3());
410
+    }
411
+}
412
+class ActionFollowPath extends b3.Action {
413
+    tick(t) {
414
+        let me = t.me;
415
+        let currentPathPointTarget = t.blackboard.currentPathPointTarget;
416
+        if (currentPathPointTarget) {
417
+            this.moveToXY(me, currentPathPointTarget.x, currentPathPointTarget.y, 300);
418
+            if (Phaser.Math.distance(me.body.center.x, me.body.center.y, currentPathPointTarget.x, currentPathPointTarget.y) < me.body.halfWidth) {
419
+                t.blackboard.currentPathPointTarget = null;
420
+            }
421
+        }
422
+        else {
423
+            let path = t.blackboard.path || [];
424
+            t.blackboard.currentPathPointTarget = path.shift();
425
+            if (path.length == 0) {
426
+                me.body.velocity.x = 0;
427
+                me.body.velocity.y = 0;
428
+                return b3.NodeState.FAILURE;
429
+            }
430
+        }
431
+        this.animate(me);
432
+        return b3.NodeState.RUNNING;
433
+    }
434
+    animate(me) {
435
+        if (Math.abs(me.body.velocity.x) > Math.abs(me.body.velocity.y)) {
436
+            if (me.body.velocity.x < 0) {
437
+                me.play("bunny.walk.left", 8, false);
438
+            }
439
+            else if (me.body.velocity.x > 0) {
440
+                me.play("bunny.walk.right", 8, false);
441
+            }
442
+            else if (me.body.velocity.y < 0) {
443
+                me.play("bunny.walk.back", 8, false);
444
+            }
445
+            else if (me.body.velocity.y > 0) {
446
+                me.play("bunny.walk.front", 8, false);
447
+            }
448
+            else {
449
+                me.play("bunny.stand.front", 0, false);
450
+            }
451
+        }
452
+        else {
453
+            if (me.body.velocity.y < 0) {
454
+                me.play("bunny.walk.back", 8, false);
455
+            }
456
+            else if (me.body.velocity.y > 0) {
457
+                me.play("bunny.walk.front", 8, false);
458
+            }
459
+            else if (me.body.velocity.x < 0) {
460
+                me.play("bunny.walk.left", 8, false);
461
+            }
462
+            else if (me.body.velocity.x > 0) {
463
+                me.play("bunny.walk.right", 8, false);
464
+            }
465
+            else {
466
+                me.play("bunny.stand.front", 0, false);
467
+            }
468
+        }
469
+    }
470
+    moveToXY(me, x, y, speed = 60) {
471
+        var angle = Math.atan2(y - me.body.center.y, x - me.body.center.x);
472
+        me.body.velocity.x = Math.cos(angle) * speed;
473
+        me.body.velocity.y = Math.sin(angle) * speed;
474
+    }
475
+}
476
+class ActionSearchAPath extends b3.Action {
477
+    constructor(...args) {
478
+        super(...args);
479
+        this.thinking = new b3.BlackboardKey();
480
+    }
481
+    tick(t) {
482
+        let thinking = t.blackboard.get(this.thinking) || false;
483
+        let me = t.me;
484
+        if (!thinking) {
485
+            t.blackboard.set(this.thinking, true);
486
+            let targetPos = me.pathfinder.randomWalkablePos();
487
+            me.pathfinder.findPath(me.body.center.x, me.body.center.y, targetPos.x, targetPos.y, (path) => {
488
+                t.blackboard.path = path || [];
489
+                t.blackboard.set(this.thinking, false);
490
+            });
491
+        }
492
+        let path = t.blackboard.path || [];
493
+        return path.length > 0 ? b3.NodeState.SUCCESS : b3.NodeState.RUNNING;
494
+    }
495
+}
496
+class ConditionFeelSafe extends b3.Action {
497
+    tick(t) {
498
+        let fearLevel = t.blackboard.fearLevel > 0 ? t.blackboard.fearLevel-- : 0;
499
+        if (fearLevel == 0) {
500
+            return b3.NodeState.SUCCESS;
501
+        }
502
+        if (fearLevel == 60) {
503
+            return b3.NodeState.FAILURE;
504
+        }
505
+        return b3.NodeState.RUNNING;
506
+    }
507
+}
508
+class ActionAttack extends b3.Action {
509
+    tick(t) {
510
+        t.me.weapon.fire(t.me.centerX, t.me.centerY);
511
+        return b3.NodeState.RUNNING;
512
+    }
513
+}
514
+//# sourceMappingURL=Bunny.js.map
515
+});
311 516
 
517
+;require.register("entities/CircularGun.ts", function(exports, require, module) {
518
+"use strict";
519
+const Bullet_ts_1 = require("./Bullet.ts");
520
+class CircularGun extends Phaser.Group {
521
+    constructor(game, maxBullets = 64, bulletsByShots = 8) {
522
+        super(game);
523
+        this.bulletSpeed = 300;
524
+        this.fireRate = 800;
525
+        this.nextFireTime = 0;
526
+        this.bulletsByShots = bulletsByShots;
527
+        for (let i = 0; i < maxBullets; ++i) {
528
+            this.add(this.createBullet());
529
+        }
530
+    }
531
+    createBullet() {
532
+        return new Bullet_ts_1.Bullet(this.game);
533
+    }
534
+    fire(fromX, fromY) {
535
+        if (this.game.time.time >= this.nextFireTime) {
536
+            for (let b = 1; b <= this.bulletsByShots; ++b) {
537
+                const bullet = this.getFirstExists(false);
538
+                if (bullet) {
539
+                    bullet.fire(fromX, fromY, b * 2 * Math.PI / this.bulletsByShots, this.bulletSpeed, 0, 0);
540
+                }
541
+            }
542
+            this.nextFireTime = this.game.time.time + this.fireRate;
543
+        }
544
+    }
545
+}
546
+exports.CircularGun = CircularGun;
547
+//# sourceMappingURL=CircularGun.js.map
312 548
 });
313 549
 
314
-require.register("entities/Grobelin.ts", function(exports, require, module) {
550
+;require.register("entities/Grobelin.ts", function(exports, require, module) {
315 551
 "use strict";
316 552
 const b3 = require("../ia/decisions/b3.ts");
317 553
 class Grobelin extends Phaser.Sprite {
... ...
@@ -327,16 +563,13 @@ class Grobelin extends Phaser.Sprite {
327 563
         this.grobelinDeath.anchor.setTo(0.5, 0.5);
328 564
         this.grobelinDeath.exists = false;
329 565
     }
330
-    getVulnerableRectangles() {
331
-        return [new Phaser.Rectangle(this.x, this.y, this.width, this.height)];
332
-    }
333 566
     appears(fromX, fromY, target) {
334 567
         const beforeGrobelin = this.game.add.sprite(fromX, fromY, 'before-bird');
335 568
         beforeGrobelin.anchor.setTo(0.5, 0.5);
336 569
         const beforeGrobelinAnimation = beforeGrobelin.animations.add('appears');
337 570
         beforeGrobelinAnimation.onComplete.add(() => {
338 571
             beforeGrobelin.destroy();
339
-            this.reset(fromX, fromY, 50);
572
+            this.reset(fromX, fromY, 20);
340 573
             this.body.setSize(16, 16, 24, 48);
341 574
             this.body.collideWorldBounds = true;
342 575
             this.blackboard = new GrobelinBlackboard();
... ...
@@ -346,7 +579,9 @@ class Grobelin extends Phaser.Sprite {
346 579
     }
347 580
     kill() {
348 581
         super.kill();
349
-        this.damageTween.stop(true);
582
+        if (this.damageTween) {
583
+            this.damageTween.stop(true);
584
+        }
350 585
         this.tint = 0xFFFFFF;
351 586
         this.grobelinDeath.reset(this.x, this.y);
352 587
         this.grobelinDeath.animations.play("lpc.hurt", 6, false).killOnComplete = true;
... ...
@@ -542,8 +777,7 @@ class ActionAttackEnemy extends b3.Action {
542 777
         }
543 778
     }
544 779
 }
545
-
546
-
780
+//# sourceMappingURL=Grobelin.js.map
547 781
 });
548 782
 
549 783
 ;require.register("entities/GrobelinHorde.ts", function(exports, require, module) {
... ...
@@ -555,7 +789,11 @@ class GrobelinHorde extends Phaser.Group {
555 789
         this.appearsRate = 10000;
556 790
         this.nextAppearsTime = 0;
557 791
         this.pathfinder = pathFinder;
792
+        this.reset(target, maxGrobelins);
793
+    }
794
+    reset(target, maxGrobelins = 4) {
558 795
         this.target = target;
796
+        this.removeAll();
559 797
         for (let i = 0; i < maxGrobelins; ++i) {
560 798
             this.add(this.createGrobelin());
561 799
         }
... ...
@@ -594,13 +832,13 @@ class GrobelinHorde extends Phaser.Group {
594 832
     }
595 833
 }
596 834
 exports.GrobelinHorde = GrobelinHorde;
597
-
598
-
835
+//# sourceMappingURL=GrobelinHorde.js.map
599 836
 });
600 837
 
601
-require.register("entities/Hero.ts", function(exports, require, module) {
838
+;require.register("entities/Hero.ts", function(exports, require, module) {
602 839
 "use strict";
603 840
 const MachineGun_ts_1 = require("./MachineGun.ts");
841
+const Bullet_ts_1 = require("./Bullet.ts");
604 842
 class Hero extends Phaser.Sprite {
605 843
     constructor(game) {
606 844
         super(game, game.world.centerX, game.world.centerY, 'tobira');
... ...
@@ -617,12 +855,12 @@ class Hero extends Phaser.Sprite {
617 855
         this.game.physics.enable(this, Phaser.Physics.ARCADE);
618 856
         this.body.setSize(16, 16, 24, 48);
619 857
         this.body.collideWorldBounds = true;
620
-        this.weapon = new MachineGun_ts_1.MachineGun(this.game);
858
+        this.weapon = new HeroMachineGun(this.game);
621 859
         this.game.add.existing(this.weapon);
622 860
     }
623 861
     static preload(game) {
624 862
         game.load.atlasXML('tobira', 'sprites/lpc/characters/tobira.png', 'sprites/lpc/characters/lpc.xml');
625
-        game.load.atlasXML('bullets', 'sprites/lpc/shootemup/effects01.png', 'sprites/lpc/shootemup/bullets.xml');
863
+        game.load.atlasXML('bullets', 'sprites/devnewton/bullets.png', 'sprites/devnewton/bullets.xml');
626 864
     }
627 865
     update() {
628 866
         super.update();
... ...
@@ -673,14 +911,18 @@ class Hero extends Phaser.Sprite {
673 911
     }
674 912
 }
675 913
 exports.Hero = Hero;
676
-
677
-
914
+class HeroMachineGun extends MachineGun_ts_1.CircularGun {
915
+    createBullet() {
916
+        return new Bullet_ts_1.Bullet(this.game, 'bullet.blue');
917
+    }
918
+}
919
+//# sourceMappingURL=Hero.js.map
678 920
 });
679 921
 
680
-require.register("entities/MachineGun.ts", function(exports, require, module) {
922
+;require.register("entities/MachineGun.ts", function(exports, require, module) {
681 923
 "use strict";
682 924
 const Bullet_ts_1 = require("./Bullet.ts");
683
-class MachineGun extends Phaser.Group {
925
+class CircularGun extends Phaser.Group {
684 926
     constructor(game, maxBullets = 64) {
685 927
         super(game);
686 928
         this.bulletSpeed = 600;
... ...
@@ -703,12 +945,11 @@ class MachineGun extends Phaser.Group {
703 945
         }
704 946
     }
705 947
 }
706
-exports.MachineGun = MachineGun;
707
-
708
-
948
+exports.CircularGun = CircularGun;
949
+//# sourceMappingURL=MachineGun.js.map
709 950
 });
710 951
 
711
-require.register("entities/Spider.ts", function(exports, require, module) {
952
+;require.register("entities/Spider.ts", function(exports, require, module) {
712 953
 "use strict";
713 954
 const b3 = require("../ia/decisions/b3.ts");
714 955
 const MachineGun_ts_1 = require("./MachineGun.ts");
... ...
@@ -724,10 +965,7 @@ class Spider extends Phaser.Sprite {
724 965
         this.spiderDeath = this.game.add.sprite(this.x, this.y, 'spider');
725 966
         this.spiderDeath.anchor.setTo(0.5, 0.5);
726 967
         this.spiderDeath.exists = false;
727
-        this.machineGun = new MachineGun_ts_1.MachineGun(this.game, 1);
728
-    }
729
-    getVulnerableRectangles() {
730
-        return [new Phaser.Rectangle(this.x, this.y, this.width, this.height)];
968
+        this.machineGun = new MachineGun_ts_1.CircularGun(this.game, 1);
731 969
     }
732 970
     appears(fromX, fromY, target) {
733 971
         const beforeSpider = this.game.add.sprite(fromX, fromY, 'before-bird');
... ...
@@ -1016,8 +1254,7 @@ class ActionAttackEnemy extends b3.Action {
1016 1254
         }
1017 1255
     }
1018 1256
 }
1019
-
1020
-
1257
+//# sourceMappingURL=Spider.js.map
1021 1258
 });
1022 1259
 
1023 1260
 ;require.register("entities/SpiderHorde.ts", function(exports, require, module) {
... ...
@@ -1029,7 +1266,11 @@ class SpiderHorde extends Phaser.Group {
1029 1266
         this.appearsRate = 10000;
1030 1267
         this.nextAppearsTime = 0;
1031 1268
         this.pathfinder = pathFinder;
1269
+        this.reset(target, maxSpiders);
1270
+    }
1271
+    reset(target, maxSpiders = 4) {
1032 1272
         this.target = target;
1273
+        this.removeAll();
1033 1274
         for (let i = 0; i < maxSpiders; ++i) {
1034 1275
             this.add(this.createSpider());
1035 1276
         }
... ...
@@ -1071,17 +1312,10 @@ class SpiderHorde extends Phaser.Group {
1071 1312
     }
1072 1313
 }
1073 1314
 exports.SpiderHorde = SpiderHorde;
1074
-
1075
-
1315
+//# sourceMappingURL=SpiderHorde.js.map
1076 1316
 });
1077 1317
 
1078
-require.register("entities/features/Vulnerable.ts", function(exports, require, module) {
1079
-"use strict";
1080
-
1081
-
1082
-});
1083
-
1084
-require.register("ia/decisions/b3.ts", function(exports, require, module) {
1318
+;require.register("ia/decisions/b3.ts", function(exports, require, module) {
1085 1319
 "use strict";
1086 1320
 class Tree {
1087 1321
     tick(me, blackboard) {
... ...
@@ -1227,11 +1461,10 @@ class Condition extends Leaf {
1227 1461
     }
1228 1462
 }
1229 1463
 exports.Condition = Condition;
1230
-
1231
-
1464
+//# sourceMappingURL=b3.js.map
1232 1465
 });
1233 1466
 
1234
-require.register("ia/services/Pathfinder.ts", function(exports, require, module) {
1467
+;require.register("ia/services/Pathfinder.ts", function(exports, require, module) {
1235 1468
 "use strict";
1236 1469
 const EasyStar = require('easystarjs');
1237 1470
 class Pathfinder {
... ...
@@ -1272,6 +1505,10 @@ class Pathfinder {
1272 1505
     findPath(startX, startY, endX, endY, callback) {
1273 1506
         const tileStart = this.map.getTileWorldXY(startX, startY);
1274 1507
         const tileEnd = this.findNearestWalkableTile(endX, endY);
1508
+        if (!tileStart) {
1509
+            console.log('cannot find path starting out of the map: (' + startX + ';' + startY + ')');
1510
+            return;
1511
+        }
1275 1512
         if (tileEnd) {
1276 1513
             this.easystar.findPath(tileStart.x, tileStart.y, tileEnd.x, tileEnd.y, (path) => {
1277 1514
                 let worldPath;
... ...
@@ -1319,11 +1556,10 @@ class Pathfinder {
1319 1556
     }
1320 1557
 }
1321 1558
 exports.Pathfinder = Pathfinder;
1322
-
1323
-
1559
+//# sourceMappingURL=Pathfinder.js.map
1324 1560
 });
1325 1561
 
1326
-require.register("states/AbstractState.ts", function(exports, require, module) {
1562
+;require.register("states/AbstractState.ts", function(exports, require, module) {
1327 1563
 "use strict";
1328 1564
 class AbstractState extends Phaser.State {
1329 1565
     constructor() {
... ...
@@ -1342,11 +1578,32 @@ class AbstractState extends Phaser.State {
1342 1578
     }
1343 1579
 }
1344 1580
 exports.AbstractState = AbstractState;
1581
+//# sourceMappingURL=AbstractState.js.map
1582
+});
1345 1583
 
1346
-
1584
+;require.register("states/DemoEnding.ts", function(exports, require, module) {
1585
+"use strict";
1586
+const AbstractState_ts_1 = require("./AbstractState.ts");
1587
+const MenuButton_ts_1 = require("../ui/MenuButton.ts");
1588
+class DemoEnding extends AbstractState_ts_1.AbstractState {
1589
+    constructor() {
1590
+        super();
1591
+    }
1592
+    preload() {
1593
+        this.game.load.image('demo_ending', 'help/demo_ending.png');
1594
+        MenuButton_ts_1.MenuButton.preload(this.game);
1595
+    }
1596
+    create() {
1597
+        super.create();
1598
+        let logo = this.game.add.sprite(0, 0, 'demo_ending');
1599
+        new MenuButton_ts_1.MenuButton(this.game, "Back", 500, 900, () => this.game.state.start('Title'));
1600
+    }
1601
+}
1602
+exports.DemoEnding = DemoEnding;
1603
+//# sourceMappingURL=DemoEnding.js.map
1347 1604
 });
1348 1605
 
1349
-require.register("states/GameOver.ts", function(exports, require, module) {
1606
+;require.register("states/GameOver.ts", function(exports, require, module) {
1350 1607
 "use strict";
1351 1608
 const AbstractState_ts_1 = require("./AbstractState.ts");
1352 1609
 class GameOver extends AbstractState_ts_1.AbstractState {
... ...
@@ -1362,11 +1619,104 @@ class GameOver extends AbstractState_ts_1.AbstractState {
1362 1619
     }
1363 1620
 }
1364 1621
 exports.GameOver = GameOver;
1622
+//# sourceMappingURL=GameOver.js.map
1623
+});
1365 1624
 
1625
+;require.register("states/GamepadOptions.ts", function(exports, require, module) {
1626
+"use strict";
1627
+const AbstractState_ts_1 = require("./AbstractState.ts");
1628
+const MenuButton_ts_1 = require("../ui/MenuButton.ts");
1629
+class GamepadOptions extends AbstractState_ts_1.AbstractState {
1630
+    constructor() {
1631
+        super();
1632
+    }
1633
+    preload() {
1634
+        MenuButton_ts_1.MenuButton.preload(this.game);
1635
+    }
1636
+    create() {
1637
+        super.create();
1638
+        let title = this.game.add.text(this.game.world.centerX, 0, 'Choose gamepad', { font: "68px monospace", fill: 'white' });
1639
+        title.scale.x = 2;
1640
+        title.scale.y = 2;
1641
+        title.anchor.setTo(0.5, 0);
1642
+        let subtitle = this.game.add.text(0, 0, 'Move stick or press button to show gamepad number', { font: "60px monospace", fill: 'white' });
1643
+        subtitle.y = this.game.world.height - subtitle.height;
1644
+        new GamepadMenuButton(this.input.gamepad.pad1, 0xFF6666, "Gamepad 1", 500, 200, () => {
1645
+            this.game.controls.usePad(this.input.gamepad.pad1);
1646
+            this.game.state.start('Options');
1647
+        });
1648
+        new GamepadMenuButton(this.input.gamepad.pad2, 0x66FF66, "Gamepad 2", 500, 350, () => {
1649
+            this.game.controls.usePad(this.input.gamepad.pad2);
1650
+            this.game.state.start('Options');
1651
+        });
1652
+        new GamepadMenuButton(this.input.gamepad.pad3, 0x6666FF, "Gamepad 3", 500, 500, () => {
1653
+            this.game.controls.usePad(this.input.gamepad.pad3);
1654
+            this.game.state.start('Options');
1655
+        });
1656
+        new GamepadMenuButton(this.input.gamepad.pad4, 0xFFFF66, "Gamepad 4", 500, 650, () => {
1657
+            this.game.controls.usePad(this.input.gamepad.pad4);
1658
+            this.game.state.start('Options');
1659
+        });
1660
+        new MenuButton_ts_1.MenuButton(this.game, "Back", 500, 800, () => this.game.state.start('Options'));
1661
+    }
1662
+}
1663
+exports.GamepadOptions = GamepadOptions;
1664
+class GamepadMenuButton extends MenuButton_ts_1.MenuButton {
1665
+    constructor(pad, activePadTint, label, x, y, callback) {
1666
+        super(pad.game, label, x, y, callback);
1667
+        this.pad = pad;
1668
+        this.activePadTint = activePadTint;
1669
+    }
1670
+    update() {
1671
+        super.update();
1672
+        if (this.isPadActive()) {
1673
+            this.tint = this.activePadTint;
1674
+        }
1675
+        else {
1676
+            this.tint = 0xFFFFFF;
1677
+        }
1678
+    }
1679
+    isPadActive() {
1680
+        for (let b = 0; b < 16; ++b) {
1681
+            let button = this.pad.getButton(b);
1682
+            if (button && button.isDown) {
1683
+                return true;
1684
+            }
1685
+        }
1686
+        for (let a = 0; a < 16; ++a) {
1687
+            if (Math.abs(this.pad.axis(a)) > this.pad.deadZone) {
1688
+                return true;
1689
+            }
1690
+        }
1691
+        return false;
1692
+    }
1693
+}
1694
+//# sourceMappingURL=GamepadOptions.js.map
1695
+});
1366 1696
 
1697
+;require.register("states/Help.ts", function(exports, require, module) {
1698
+"use strict";
1699
+const AbstractState_ts_1 = require("./AbstractState.ts");
1700
+const MenuButton_ts_1 = require("../ui/MenuButton.ts");
1701
+class Help extends AbstractState_ts_1.AbstractState {
1702
+    constructor() {
1703
+        super();
1704
+    }
1705
+    preload() {
1706
+        this.game.load.image('help', 'help/help.png');
1707
+        MenuButton_ts_1.MenuButton.preload(this.game);
1708
+    }
1709
+    create() {
1710
+        super.create();
1711
+        let logo = this.game.add.sprite(0, 0, 'help');
1712
+        new MenuButton_ts_1.MenuButton(this.game, "Back", 500, 900, () => this.game.state.start('Title'));
1713
+    }
1714
+}
1715
+exports.Help = Help;
1716
+//# sourceMappingURL=Help.js.map
1367 1717
 });
1368 1718
 
1369
-require.register("states/Intro.ts", function(exports, require, module) {
1719
+;require.register("states/Intro.ts", function(exports, require, module) {
1370 1720
 "use strict";
1371 1721
 const AbstractState_ts_1 = require("./AbstractState.ts");
1372 1722
 class Intro extends AbstractState_ts_1.AbstractState {
... ...
@@ -1385,28 +1735,67 @@ class Intro extends AbstractState_ts_1.AbstractState {
1385 1735
     }
1386 1736
 }
1387 1737
 exports.Intro = Intro;
1738
+//# sourceMappingURL=Intro.js.map
1739
+});
1388 1740
 
1389
-
1741
+;require.register("states/KeyboardOptions.ts", function(exports, require, module) {
1742
+"use strict";
1743
+const AbstractState_ts_1 = require("./AbstractState.ts");
1744
+const MenuButton_ts_1 = require("../ui/MenuButton.ts");
1745
+class KeyboardOptions extends AbstractState_ts_1.AbstractState {
1746
+    constructor() {
1747
+        super();
1748
+    }
1749
+    preload() {
1750
+        MenuButton_ts_1.MenuButton.preload(this.game);
1751
+    }
1752
+    create() {
1753
+        super.create();
1754
+        let logo = this.game.add.text(this.game.world.centerX, 0, 'Choose keyboard layout', { font: "68px monospace", fill: 'white' });
1755
+        logo.scale.x = 2;
1756
+        logo.scale.y = 2;
1757
+        logo.anchor.setTo(0.5, 0);
1758
+        new MenuButton_ts_1.MenuButton(this.game, "Azerty zsqd", 500, 300, () => {
1759
+            this.game.controls.useAzertyLayout();
1760
+            this.game.state.start('Options');
1761
+        });
1762
+        new MenuButton_ts_1.MenuButton(this.game, "Qwerty wsad", 500, 450, () => {
1763
+            this.game.controls.useQwertyLayout();
1764
+            this.game.state.start('Options');
1765
+        });
1766
+        new MenuButton_ts_1.MenuButton(this.game, "Other ⬆⬇⬅➡", 500, 600, () => {
1767
+            this.game.controls.useOtherLayout();
1768
+            this.game.state.start('Options');
1769
+        });
1770
+        new MenuButton_ts_1.MenuButton(this.game, "Back", 500, 750, () => this.game.state.start('Options'));
1771
+    }
1772
+}
1773
+exports.KeyboardOptions = KeyboardOptions;
1774
+//# sourceMappingURL=KeyboardOptions.js.map
1390 1775
 });
1391 1776
 
1392
-require.register("states/Level.ts", function(exports, require, module) {
1777
+;require.register("states/Level.ts", function(exports, require, module) {
1393 1778
 "use strict";
1394 1779
 const AbstractState_ts_1 = require("./AbstractState.ts");
1395 1780
 const Hero_ts_1 = require("../entities/Hero.ts");
1396 1781
 const BirdFlock_ts_1 = require("../entities/BirdFlock.ts");
1397 1782
 const GrobelinHorde_ts_1 = require("../entities/GrobelinHorde.ts");
1398 1783
 const SpiderHorde_ts_1 = require("../entities/SpiderHorde.ts");
1784
+const Bunny_ts_1 = require("../entities/Bunny.ts");
1399 1785
 const Pathfinder_ts_1 = require("../ia/services/Pathfinder.ts");
1400 1786
 const DamageResolver_ts_1 = require("../utils/DamageResolver.ts");
1787
+const Dialog_ts_1 = require("../ui/Dialog.ts");
1401 1788
 class Level extends AbstractState_ts_1.AbstractState {
1402 1789
     constructor() {
1403 1790
         super();
1791
+        this.shouldCheckBunnyLiving = false;
1404 1792
     }
1405 1793
     preload() {
1406 1794
         BirdFlock_ts_1.BirdFlock.preload(this.game);
1407 1795
         GrobelinHorde_ts_1.GrobelinHorde.preload(this.game);
1408 1796
         SpiderHorde_ts_1.SpiderHorde.preload(this.game);
1409 1797
         Hero_ts_1.Hero.preload(this.game);
1798
+        Bunny_ts_1.Bunny.preload(this.game);
1410 1799
         this.game.load.tilemap('map', 'levels/level1.json', null, Phaser.Tilemap.TILED_JSON);
1411 1800
         this.game.load.image('terrains', 'sprites/lpc/terrains/terrains.png');
1412 1801
         this.game.load.image('cottage', 'sprites/lpc/thatched-roof-cottage/cottage.png');
... ...
@@ -1414,6 +1803,7 @@ class Level extends AbstractState_ts_1.AbstractState {
1414 1803
         this.game.load.image('doors', 'sprites/lpc/windows-doors/doors.png');
1415 1804
         this.game.load.image('windows', 'sprites/lpc/windows-doors/windows.png');
1416 1805
         this.game.load.image('obj_misk_atlas', 'sprites/lpc/tile-atlas2/obj_misk_atlas.png');
1806
+        Dialog_ts_1.Dialog.preload(this.game);
1417 1807
     }
1418 1808
     create() {
1419 1809
         super.create();
... ...
@@ -1448,58 +1838,206 @@ class Level extends AbstractState_ts_1.AbstractState {
1448 1838
         this.pathfinder = new Pathfinder_ts_1.Pathfinder(map);
1449 1839
         this.hero = new Hero_ts_1.Hero(this.game);
1450 1840
         this.game.add.existing(this.hero);
1451
-        this.birdFlock = new BirdFlock_ts_1.BirdFlock(this.hero);
1841
+        this.birdFlock = new BirdFlock_ts_1.BirdFlock(this.hero, 0);
1452 1842
         this.game.add.existing(this.birdFlock);
1453
-        this.grobelinHorde = new GrobelinHorde_ts_1.GrobelinHorde(this.hero, this.pathfinder);
1843
+        this.grobelinHorde = new GrobelinHorde_ts_1.GrobelinHorde(this.hero, this.pathfinder, 0);
1454 1844
         this.game.add.existing(this.grobelinHorde);
1455
-        this.spiderHorde = new SpiderHorde_ts_1.SpiderHorde(this.hero, this.pathfinder);
1845
+        this.spiderHorde = new SpiderHorde_ts_1.SpiderHorde(this.hero, this.pathfinder, 0);
1456 1846
         this.game.add.existing(this.spiderHorde);
1847
+        this.bunnyGroup = this.game.add.group();
1848
+        this.startDialog();
1849
+    }
1850
+    startDialog() {
1851
+        let dialog = new Dialog_ts_1.Dialog(this.game, "What a beautiful day! I do not regret leaving the magic university to live in this farm with my wife, Clementine.");
1852
+        dialog.onFinishCallback = () => {
1853
+            dialog.text = "Speaking of her, she should be back from the forest soon. I hope she catched something good for diner.";
1854
+            dialog.onFinishCallback = () => {
1855
+                dialog.text = "Mmh that's strange, I am suddently feeling magic around and not a good one...";
1856
+                dialog.onFinishCallback = () => {
1857
+                    dialog.destroy();
1858
+                    this.startAction();
1859
+                };
1860
+            };
1861
+        };
1862
+    }
1863
+    endingDialog() {
1864
+        let dialog = new Dialog_ts_1.Dialog(this.game, "What was that? It looks like somebody has invoked monsters and sent them to... me?");
1865
+        dialog.onFinishCallback = () => {
1866
+            dialog.text = "Clementine! I must go to the forest, maybe she is in danger!";
1867
+            dialog.onFinishCallback = () => {
1868
+                this.game.state.start('DemoEnding');
1869
+            };
1870
+        };
1871
+    }
1872
+    startAction() {
1873
+        this.game.time.events.add(1000, () => this.grobelinHorde.reset(this.hero, 3));
1874
+        this.game.time.events.add(20 * 1000, () => this.spiderHorde.reset(this.hero, 4));
1875
+        this.game.time.events.add(40 * 1000, () => this.birdFlock.reset(this.hero, 10));
1876
+        this.game.time.events.add(60 * 1000, () => {
1877
+            this.birdFlock.flyRate = Number.MAX_VALUE;
1878
+            this.spiderHorde.appearsRate = Number.MAX_VALUE;
1879
+            this.grobelinHorde.appearsRate = Number.MAX_VALUE;
1880
+        });
1881
+        this.game.time.events.add(80 * 1000, () => {
1882
+            for (let i = 0; i < 4; ++i) {
1883
+                let pos = this.pathfinder.randomWalkablePos();
1884
+                let bunny = new Bunny_ts_1.Bunny(this.game, this.pathfinder);
1885
+                bunny.appears(pos.x, pos.y);
1886
+                this.bunnyGroup.add(bunny);
1887
+            }
1888
+            this.shouldCheckBunnyLiving = true;
1889
+        });
1457 1890
     }
1458 1891
     update() {
1459 1892
         this.pathfinder.update();
1460
-        this.hero.update();
1461 1893
         this.game.physics.arcade.collide(this.hero, this.collisionSprites);
1462 1894
         this.resolveWeaponsEffects();
1895
+        if (this.shouldCheckBunnyLiving && this.bunnyGroup.countLiving() == 0) {
1896
+            this.shouldCheckBunnyLiving = false;
1897
+            this.game.time.events.add(3 * 1000, () => {
1898
+                this.endingDialog();
1899
+            });
1900
+        }
1463 1901
     }
1464 1902
     resolveWeaponsEffects() {
1465
-        this.damageResolver.resolve(this.birdFlock, this.hero.weapon);
1466
-        this.damageResolver.resolve(this.hero, this.birdFlock);
1467
-        this.damageResolver.resolve(this.hero.weapon, this.grobelinHorde);
1468
-        this.damageResolver.resolve(this.hero.weapon, this.spiderHorde);
1903
+        this.damageResolver.groupVersusGroup(this.hero.weapon, this.bunnyGroup);
1904
+        for (let bunny of this.bunnyGroup.children) {
1905
+            this.damageResolver.spriteVersusGroup(this.hero, bunny.weapon);
1906
+        }
1907
+        this.damageResolver.spriteVersusGroup(this.hero, this.birdFlock);
1908
+        this.damageResolver.groupVersusGroup(this.hero.weapon, this.birdFlock);
1909
+        this.damageResolver.spriteVersusGroup(this.hero, this.birdFlock);
1910
+        this.damageResolver.groupVersusGroup(this.hero.weapon, this.grobelinHorde);
1911
+        this.damageResolver.groupVersusGroup(this.hero.weapon, this.spiderHorde);
1469 1912
         for (let spider of this.spiderHorde.children) {
1470
-            this.damageResolver.resolve(this.hero, spider.machineGun);
1913
+            this.damageResolver.spriteVersusGroup(this.hero, spider.machineGun);
1471 1914
         }
1472 1915
     }
1473 1916
     render() {
1474 1917
     }
1475 1918
 }
1476 1919
 exports.Level = Level;
1920
+//# sourceMappingURL=Level.js.map
1921
+});
1477 1922
 
1478
-
1923
+;require.register("states/Options.ts", function(exports, require, module) {
1924
+"use strict";
1925
+const AbstractState_ts_1 = require("./AbstractState.ts");
1926
+const MenuButton_ts_1 = require("../ui/MenuButton.ts");
1927
+class Options extends AbstractState_ts_1.AbstractState {
1928
+    constructor() {
1929
+        super();
1930
+    }
1931
+    preload() {
1932
+        MenuButton_ts_1.MenuButton.preload(this.game);
1933
+    }
1934
+    create() {
1935
+        super.create();
1936
+        let logo = this.game.add.text(this.game.world.centerX, 0, 'Options', { font: "120px monospace", fill: 'white' });
1937
+        logo.scale.x = 2;
1938
+        logo.scale.y = 2;
1939
+        logo.anchor.setTo(0.5, 0);
1940
+        let y = 150;
1941
+        new MenuButton_ts_1.MenuButton(this.game, "Keyboard", 500, y += 150, () => this.game.state.start('KeyboardOptions'));
1942
+        if (this.input.gamepad.supported) {
1943
+            new MenuButton_ts_1.MenuButton(this.game, "Gamepad", 500, y += 150, () => this.game.state.start('GamepadOptions'));
1944
+        }
1945
+        new MenuButton_ts_1.MenuButton(this.game, "Back", 500, y += 150, () => this.game.state.start('Title'));
1946
+    }
1947
+}
1948
+exports.Options = Options;
1949
+//# sourceMappingURL=Options.js.map
1479 1950
 });
1480 1951
 
1481
-require.register("states/Title.ts", function(exports, require, module) {
1952
+;require.register("states/Title.ts", function(exports, require, module) {
1482 1953
 "use strict";
1483 1954
 const AbstractState_ts_1 = require("./AbstractState.ts");
1955
+const MenuButton_ts_1 = require("../ui/MenuButton.ts");
1484 1956
 class Title extends AbstractState_ts_1.AbstractState {
1485 1957
     constructor() {
1486 1958
         super();
1487 1959
     }
1488 1960
     preload() {
1489 1961
         this.game.load.image('logo', 'title/logo.png');
1962
+        MenuButton_ts_1.MenuButton.preload(this.game);
1490 1963
     }
1491 1964
     create() {
1492 1965
         super.create();
1493
-        var logo = this.game.add.sprite(this.game.world.centerX, this.game.world.centerY, 'logo');
1494
-        logo.anchor.setTo(0.5, 0.5);
1966
+        let logo = this.game.add.sprite(this.game.world.centerX, 0, 'logo');
1967
+        logo.scale.x = 2;
1968
+        logo.scale.y = 2;
1969
+        logo.anchor.setTo(0.5, 0);
1970
+        new MenuButton_ts_1.MenuButton(this.game, "Start", 500, 300, () => this.game.state.start('Level'));
1971
+        new MenuButton_ts_1.MenuButton(this.game, "Options", 500, 450, () => this.game.state.start('Options'));
1972
+        new MenuButton_ts_1.MenuButton(this.game, "Help", 500, 600, () => this.game.state.start('Help'));
1495 1973
     }
1496 1974
 }
1497 1975
 exports.Title = Title;
1976
+//# sourceMappingURL=Title.js.map
1977
+});
1498 1978
 
1979
+;require.register("ui/Dialog.ts", function(exports, require, module) {
1980
+"use strict";
1981
+class Dialog extends Phaser.Group {
1982
+    constructor(game, text) {
1983
+        super(game);
1984
+        this.passButtonWasDown = false;
1985
+        let dialogBackground = game.add.image(0, 600, "dialog_bg", null, this);
1986
+        dialogBackground.alpha = 0.9;
1987
+        this.dialogText = game.add.text(game.world.centerX, 630, text, {
1988
+            font: "64px monospace",
1989
+            fill: "white",
1990
+            wordWrap: true,
1991
+            wordWrapWidth: 1900
1992
+        }, this);
1993
+        this.dialogText.anchor.x = 0.5;
1994
+        game.add.existing(this);
1995
+        this.controls = game.controls;
1996
+    }
1997
+    set text(text) {
1998
+        this.dialogText.text = text;
1999
+    }
2000
+    static preload(game) {
2001
+        game.load.image('dialog_bg', 'dialog/dialog_bg.png');
2002
+    }
2003
+    update() {
2004
+        let passButtonIsDown = this.controls.isPassDialogButtonDown();
2005
+        if (this.passButtonWasDown && !passButtonIsDown) {
2006
+            this.passButtonWasDown = false;
2007
+            if (this.onFinishCallback) {
2008
+                this.onFinishCallback();
2009
+            }
2010
+        }
2011
+        else {
2012
+            this.passButtonWasDown = passButtonIsDown;
2013
+        }
2014
+    }
2015
+}
2016
+exports.Dialog = Dialog;
2017
+//# sourceMappingURL=Dialog.js.map
2018
+});
1499 2019
 
2020
+;require.register("ui/MenuButton.ts", function(exports, require, module) {
2021
+"use strict";
2022
+class MenuButton extends Phaser.Button {
2023
+    constructor(game, label, x, y, callback) {
2024
+        super(game, x, y, 'menu-buttons', callback, null, 'over', 'out', 'down');
2025
+        this.labelText = new Phaser.Text(this.game, 140, 15, label, { font: "64px monospace", fill: 'white' });
2026
+        this.addChild(this.labelText);
2027
+        game.add.existing(this);
2028
+    }
2029
+    setText(text) {
2030
+        this.labelText.setText(text);
2031
+    }
2032
+    static preload(game) {
2033
+        game.load.atlasXML('menu-buttons', 'menu/buttons.png', 'menu/buttons.xml');
2034
+    }
2035
+}
2036
+exports.MenuButton = MenuButton;
2037
+//# sourceMappingURL=MenuButton.js.map
1500 2038
 });
1501 2039
 
1502
-require.register("utils/Controls.ts", function(exports, require, module) {
2040
+;require.register("utils/Controls.ts", function(exports, require, module) {
1503 2041
 "use strict";
1504 2042
 class Controls {
1505 2043
     constructor(game) {
... ...
@@ -1507,9 +2045,39 @@ class Controls {
1507 2045
         game.input.gamepad.start();
1508 2046
         this.kb = game.input.keyboard;
1509 2047
         this.pad = game.input.gamepad.pad1;
2048
+        if (localStorage.getItem('keyboard.layout') == 'qwerty') {
2049
+            this.useQwertyLayout();
2050
+        }
2051
+        else {
2052
+            this.useAzertyLayout();
2053
+        }
2054
+    }
2055
+    usePad(pad) {
2056
+        this.pad = pad;
2057
+    }
2058
+    useAzertyLayout() {
2059
+        this.keyCodeUP = Phaser.KeyCode.Z;
2060
+        this.keyCodeDOWN = Phaser.KeyCode.S;
2061
+        this.keyCodeLEFT = Phaser.KeyCode.Q;
2062
+        this.keyCodeRIGHT = Phaser.KeyCode.D;
2063
+        localStorage.setItem('keyboard.layout', 'azerty');
2064
+    }
2065
+    useQwertyLayout() {
2066
+        this.keyCodeUP = Phaser.KeyCode.W;
2067
+        this.keyCodeDOWN = Phaser.KeyCode.S;
2068
+        this.keyCodeLEFT = Phaser.KeyCode.A;
2069
+        this.keyCodeRIGHT = Phaser.KeyCode.D;
2070
+        localStorage.setItem('keyboard.layout', 'qwerty');
2071
+    }
2072
+    useOtherLayout() {
2073
+        this.keyCodeUP = Phaser.KeyCode.UP;
2074
+        this.keyCodeDOWN = Phaser.KeyCode.DOWN;
2075
+        this.keyCodeLEFT = Phaser.KeyCode.LEFT;
2076
+        this.keyCodeRIGHT = Phaser.KeyCode.RIGHT;
2077
+        localStorage.setItem('keyboard.layout', 'other');
1510 2078
     }
1511 2079
     shootingAngle(shooterX, shooterY) {
1512
-        return this.firstNonNull(this.shootingAngleFromPointer(shooterX, shooterY), this.shootingAngleFromPad(), this.shootingFromKeyboard());
2080
+        return this.firstNonNull(this.shootingAngleFromPointer(shooterX, shooterY), this.shootingAngleFromPad());
1513 2081
     }
1514 2082
     firstNonNull(...values) {
1515 2083
         for (let value of values) {
... ...
@@ -1525,7 +2093,7 @@ class Controls {
1525 2093
             return Phaser.Math.angleBetween(shooterX, shooterY, pointer.worldX, pointer.worldY);
1526 2094
         }
1527 2095
         else {
1528
-            return this.shootingFromKeyboard();
2096
+            return null;
1529 2097
         }
1530 2098
     }
1531 2099
     shootingAngleFromPad() {
... ...
@@ -1540,113 +2108,75 @@ class Controls {
1540 2108
             return null;
1541 2109
         }
1542 2110
     }
1543
-    shootingFromKeyboard() {
1544
-        let dx = 0;
1545
-        if (this.kb.isDown(Phaser.KeyCode.J)) {
1546
-            dx = -1;
1547
-        }
1548
-        else if (this.kb.isDown(Phaser.KeyCode.L)) {
1549
-            dx = 1;
1550
-        }
1551
-        let dy = 0;
1552
-        if (this.kb.isDown(Phaser.KeyCode.I)) {
1553
-            dy = -1;
1554
-        }
1555
-        else if (this.kb.isDown(Phaser.KeyCode.K)) {
1556
-            dy = 1;
1557
-        }
1558
-        if (dx != 0 || dy != 0) {
1559
-            return Phaser.Math.angleBetween(0, 0, dx, dy);
1560
-        }
1561
-        else {
1562
-            return null;
1563
-        }
1564
-    }
1565 2111
     isGoingUp() {
1566 2112
         return this.pad.isDown(Phaser.Gamepad.XBOX360_DPAD_UP)
1567 2113
             || this.pad.axis(Phaser.Gamepad.XBOX360_STICK_LEFT_Y) < -this.pad.deadZone
1568 2114
             || this.kb.isDown(Phaser.KeyCode.UP)
1569
-            || this.kb.isDown(Phaser.KeyCode.Z);
2115
+            || this.kb.isDown(this.keyCodeUP);
1570 2116
     }
1571 2117
     isGoingDown() {
1572 2118
         return this.pad.isDown(Phaser.Gamepad.XBOX360_DPAD_DOWN)
1573 2119
             || this.pad.axis(Phaser.Gamepad.XBOX360_STICK_LEFT_Y) > this.pad.deadZone
1574 2120
             || this.kb.isDown(Phaser.KeyCode.DOWN)
1575
-            || this.kb.isDown(Phaser.KeyCode.S);
2121
+            || this.kb.isDown(this.keyCodeDOWN);
1576 2122
     }
1577 2123
     isGoingLeft() {
1578 2124
         return this.pad.isDown(Phaser.Gamepad.XBOX360_DPAD_LEFT)
1579 2125
             || this.pad.axis(Phaser.Gamepad.XBOX360_STICK_LEFT_X) < -this.pad.deadZone
1580 2126
             || this.kb.isDown(Phaser.KeyCode.LEFT)
1581
-            || this.kb.isDown(Phaser.KeyCode.Q);
2127
+            || this.kb.isDown(this.keyCodeLEFT);
1582 2128
     }
1583 2129
     isGoingRight() {
1584 2130
         return this.pad.isDown(Phaser.Gamepad.XBOX360_DPAD_RIGHT)
1585 2131
             || this.pad.axis(Phaser.Gamepad.XBOX360_STICK_LEFT_X) > this.pad.deadZone
1586 2132
             || this.kb.isDown(Phaser.KeyCode.RIGHT)
1587
-            || this.kb.isDown(Phaser.KeyCode.D);
2133
+            || this.kb.isDown(this.keyCodeRIGHT);
2134
+    }
2135
+    isPassDialogButtonDown() {
2136
+        return this.game.input.activePointer.isDown
2137
+            || this.pad.isDown(Phaser.Gamepad.XBOX360_A);
1588 2138
     }
1589 2139
 }
1590 2140
 exports.Controls = Controls;
1591
-
1592
-
2141
+//# sourceMappingURL=Controls.js.map
1593 2142
 });
1594 2143
 
1595
-require.register("utils/DamageResolver.ts", function(exports, require, module) {
2144
+;require.register("utils/DamageResolver.ts", function(exports, require, module) {
1596 2145
 "use strict";
1597 2146
 class DamageResolver {
1598 2147
     constructor(game) {
1599 2148
         this.game = game;
1600 2149
     }
1601
-    resolve(spriteOrGroupA, spriteOrGroupB) {
1602
-        this.game.physics.arcade.overlap(spriteOrGroupA, spriteOrGroupB, (a, b) => {
1603
-            const vulnerableA = a;
1604
-            if (DamageResolver.checkIfSpritesIntersect(a, b)) {
1605
-                a.damage(1);
1606
-                b.damage(1);
2150
+    groupVersusGroup(groupA, groupB) {
2151
+        for (let spriteA of groupA.children) {
2152
+            if (spriteA instanceof Phaser.Sprite) {
2153
+                this.spriteVersusGroup(spriteA, groupB);
1607 2154
             }
1608
-        });
1609
-    }
1610
-    static checkIfSpritesIntersect(a, b) {
1611
-        let vulnerableRectangleOfA = DamageResolver.getVulnerableRectanglesOf(a);
1612
-        let vulnerableRectangleOfB = DamageResolver.getVulnerableRectanglesOf(b);
1613
-        if (vulnerableRectangleOfA || vulnerableRectangleOfB) {
1614
-            vulnerableRectangleOfA = vulnerableRectangleOfA || [new Phaser.Rectangle(a.x, a.y, a.width, a.height)];
1615
-            vulnerableRectangleOfB = vulnerableRectangleOfB || [new Phaser.Rectangle(b.x, b.y, b.width, b.height)];
1616
-            return this.checkIfRectanglesIntersect(vulnerableRectangleOfA, vulnerableRectangleOfB);
1617
-        }
1618
-        else {
1619
-            return true;
1620 2155
         }
1621 2156
     }
1622
-    static checkIfRectanglesIntersect(rectanglesA, rectanglesB) {
1623
-        for (let a of rectanglesA) {
1624
-            for (let b of rectanglesB) {
1625
-                if (a.intersects(b, 1)) {
1626
-                    return true;
2157
+    spriteVersusGroup(spriteA, groupB) {
2158
+        if (spriteA.exists) {
2159
+            for (let spriteB of groupB.children) {
2160
+                if (spriteB instanceof Phaser.Sprite) {
2161
+                    this.spriteVersusSprite(spriteA, spriteB);
1627 2162
                 }
1628 2163
             }
1629 2164
         }
1630
-        return false;
1631 2165
     }
1632
-    static getVulnerableRectanglesOf(s) {
1633
-        let result;
1634
-        if (DamageResolver.isVulnerable(s)) {
1635
-            result = s.getVulnerableRectangles();
2166
+    spriteVersusSprite(spriteA, spriteB) {
2167
+        if (spriteA.exists && spriteB.exists && spriteA.overlap(spriteB)) {
2168
+            spriteA.damage(1);
2169
+            spriteB.damage(1);
1636 2170
         }
1637
-        return result;
1638
-    }
1639
-    static isVulnerable(s) {
1640
-        return s.getVulnerableRectangles != undefined;
1641 2171
     }
1642 2172
 }
1643 2173
 exports.DamageResolver = DamageResolver;
1644
-
1645
-
2174
+//# sourceMappingURL=DamageResolver.js.map
1646 2175
 });
1647 2176
 
1648
-require.register("___globals___", function(exports, require, module) {
2177
+;require.register("___globals___", function(exports, require, module) {
1649 2178
   
1650 2179
 });})();require('___globals___');
1651 2180
 
1652
-require('ShmuprpgApp');
1653 2181
\ No newline at end of file
2182
+require('ShmuprpgApp');
2183
+//# sourceMappingURL=app.js.map
1654 2184
\ No newline at end of file
1655 2185
new file mode 100644
... ...
@@ -0,0 +1 @@
1
+{"version":3,"sources":["app/ShmuprpgApp.ts","app/ShmuprpgGame.ts","app/entities/Bird.ts","app/entities/BirdFlock.ts","app/entities/Bullet.ts","app/entities/Bunny.ts","app/entities/CircularGun.ts","app/entities/Grobelin.ts","app/entities/GrobelinHorde.ts","app/entities/Hero.ts","app/entities/MachineGun.ts","app/entities/Spider.ts","app/entities/SpiderHorde.ts","app/ia/decisions/b3.ts","app/ia/services/Pathfinder.ts","app/states/AbstractState.ts","app/states/DemoEnding.ts","app/states/GameOver.ts","app/states/GamepadOptions.ts","app/states/Help.ts","app/states/Intro.ts","app/states/KeyboardOptions.ts","app/states/Level.ts","app/states/Options.ts","app/states/Title.ts","app/ui/Dialog.ts","app/ui/MenuButton.ts","app/utils/Controls.ts","app/utils/DamageResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kCAA6B,mBAAmB,CAAC;AAEjD,IAAI,8BAAY,EAAE,CAAC;;;;;;ACDnB,2BAAoB,mBAAmB,CAAC;AACxC,2BAAoB,mBAAmB,CAAC;AACxC,gCAAyB,wBAAwB,CAAC;AAClD,0BAAmB,kBAAkB,CAAC;AACtC,6BAAsB,qBAAqB,CAAC;AAC5C,qCAA8B,6BAA6B,CAAC;AAC5D,o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AE,MAAM,CAAC,CAAC;YAC5C,CAAC;QACL,CAAC;IACL,CAAC;IAED,iBAAiB,CAAC,OAAsB,EAAE,MAAoB;QAC1D,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;YACjB,GAAG,CAAC,CAAC,IAAI,OAAO,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAClC,EAAE,CAAC,CAAC,OAAO,YAAY,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;oBACnC,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBAC9C,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAED,kBAAkB,CAAC,OAAsB,EAAE,OAAsB;QAC7D,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAC/D,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAClB,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;IACL,CAAC;AAEL,CAAC;AAhCY,sBAAc,iBAgC1B","file":"public/app.js","sourcesContent":["import { ShmuprpgGame } from \"./ShmuprpgGame.ts\";\n\nnew ShmuprpgGame();","/// <reference path=\"../typings/phaser.d.ts\"/>\nimport {Intro} from \"./states/Intro.ts\";\nimport {Title} from \"./states/Title.ts\";\nimport {DemoEnding} from \"./states/DemoEnding.ts\";\nimport {Help} from \"./states/Help.ts\";\nimport {Options} from \"./states/Options.ts\";\nimport {KeyboardOptions} from \"./states/KeyboardOptions.ts\";\nimport {GamepadOptions} from \"./states/GamepadOptions.ts\";\nimport {Level} from \"./states/Level.ts\";\nimport {GameOver} from \"./states/GameOver.ts\";\nimport {Controls} from \"./utils/Controls.ts\";\n\nexport class ShmuprpgGame extends Phaser.Game {\n\n    controls: Controls;\n\n    constructor() {\n        super(1920, 1080, Phaser.CANVAS, 'game', {\n            preload: () => this.preloadGame()\n            , create: () => this.createGame()\n        });\n        this.state.add('Intro', Intro);\n        this.state.add('Title', Title);\n        this.state.add('Help', Help);\n        this.state.add('Options', Options);\n        this.state.add('KeyboardOptions', KeyboardOptions);\n        this.state.add('GamepadOptions', GamepadOptions);\n        this.state.add('Level', Level);\n        this.state.add('GameOver', GameOver);\n        this.state.add('DemoEnding', DemoEnding);\n    }\n\n    preloadGame() {\n        this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;\n        this.scale.fullScreenScaleMode = Phaser.ScaleManager.SHOW_ALL;\n        this.scale.pageAlignHorizontally = true;\n        this.scale.pageAlignVertically = true;\n    }\n\n    createGame() {\n        this.controls = new Controls(this);\n        this.state.start('Title');\n    }\n\n    addSpriteAnimation(sprite: Phaser.Sprite, animationName: string, frameCount: number): Phaser.Animation {\n        return sprite.animations.add(animationName, this.genAnimArray(animationName, frameCount));\n    }\n\n    private genAnimArray(name: string, n: number) {\n        let result = new Array<string>();\n        for (let i = 0; i < n; ++i) {\n            result.push(name + i);\n        }\n        return result;\n    }\n\n}","/// <reference path=\"../../typings/phaser.d.ts\"/>\n\nexport class Bird extends Phaser.Sprite {\n\n    birdExplosion: Phaser.Sprite;\n\n    constructor(game: Phaser.Game) {\n        super(game, 0, 0, 'bird');\n        this.animations.add('fly');\n        this.game.physics.enable(this, Phaser.Physics.ARCADE);\n        this.anchor.setTo(0.5, 0.5);\n        this.checkWorldBounds = true;\n        this.outOfBoundsKill = true;\n        this.exists = false;\n        this.birdExplosion = this.game.add.sprite(this.x, this.y, 'bird-explosion');\n        this.birdExplosion.anchor.setTo(0.5, 0.5);\n        this.birdExplosion.exists = false;\n        const explodeAnimation = this.birdExplosion.animations.add('explode');\n        explodeAnimation.killOnComplete = true;\n    }\n\n    fly(fromX: number, fromY: number, angle: number) {\n        const beforeBird = this.game.add.sprite(fromX, fromY, 'before-bird');\n        beforeBird.anchor.setTo(0.5, 0.5);\n        const beforeBirdAnimation = beforeBird.animations.add('appears');\n        beforeBirdAnimation.onComplete.add(() => {\n            beforeBird.destroy();\n            this.reset(fromX, fromY, 1);\n            this.play('fly', 8, true);\n            this.game.physics.arcade.velocityFromRotation(angle, 300, this.body.velocity);\n            this.scale.set(this.body.velocity.x < 0 ? -1 : 1, 1);\n        });\n        beforeBirdAnimation.play(4, false);\n    }\n\n    kill(): Phaser.Sprite {\n        super.kill();\n        this.birdExplosion.reset(this.x, this.y);\n        this.birdExplosion.play('explode', 8, false);\n        return this;\n    }\n    \n}\n","/// <reference path=\"../../typings/phaser.d.ts\"/>\nimport {Bird} from \"./Bird.ts\";\n\nexport class BirdFlock extends Phaser.Group {\n\n    flyRate = 1000;\n    target: Phaser.Sprite;\n    private nextFlyTime = 0;\n\n    constructor(target: Phaser.Sprite, maxBirds: number = 10) {\n        super(target.game);\n        this.reset(target, maxBirds);\n    }\n\n    reset(target: Phaser.Sprite, maxBirds: number = 10) {\n        this.target = target;\n        this.removeAll();\n        for (let i = 0; i < maxBirds; ++i) {\n            this.add(this.createBird());\n        }\n    }\n\n    static preload(game: Phaser.Game) {\n        game.load.spritesheet('bird', 'sprites/oga/tower-defense-prototyping-assets-4-monsters-some-tiles-a-background-image/bird.png', 48, 48, 5);\n        game.load.spritesheet('before-bird', 'sprites/oga/rpg-special-move-effects/VioletSlash.png', 64, 64, 4);\n        game.load.spritesheet('bird-explosion', 'sprites/oga/space_shooter_pack/explosion.png', 16, 16, 5);\n    }\n\n    update() {\n        super.update();\n        const x = this.game.world.randomX;\n        const y = this.game.world.randomY;\n        const angle = Phaser.Math.angleBetween(x, y, this.target.x, this.target.y);\n        this.fly(x, y, angle);\n    }\n\n    private createBird(): Bird {\n        return new Bird(this.game);\n    }\n\n    private fly(fromX: number, fromY: number, angle: number) {\n        if (this.game.time.time >= this.nextFlyTime) {\n            const bird = this.getFirstExists(false);\n            if (bird) {\n                bird.fly(fromX, fromY, angle);\n                this.nextFlyTime = this.game.time.time + this.flyRate;\n            }\n        }\n    }\n}","/// <reference path=\"../../typings/phaser.d.ts\"/>\nimport { ShmuprpgGame } from \"../ShmuprpgGame\";\n\nexport class Bullet extends Phaser.Sprite {\n\n    bulletAnimation: string;\n\n    constructor(game: Phaser.Game, animation = 'bullet.red', atlas = 'bullets') {\n        super(game, 0, 0, atlas);\n        this.bulletAnimation = animation;\n        (<ShmuprpgGame>game).addSpriteAnimation(this, this.bulletAnimation, 4);\n        this.game.physics.enable(this, Phaser.Physics.ARCADE);\n        this.anchor.setTo(0.5, 0.5);\n        this.checkWorldBounds = true;\n        this.outOfBoundsKill = true;\n        this.exists = false;\n        this.health = 0;\n        this.alive = false;\n    }\n\n    fire(fromX: number, fromY: number, angle: number, speed: number, gravityX: number, gravityY: number) {\n        this.reset(fromX, fromY, 1);\n        this.scale.set(1);\n        this.game.physics.arcade.velocityFromRotation(angle, speed, this.body.velocity);\n        this.angle = angle;\n        this.body.gravity.set(gravityX, gravityY);\n        this.play(this.bulletAnimation, 4, true);\n    }\n}\n","/// <reference path=\"../../typings/phaser.d.ts\"/>\nimport {ShmuprpgGame} from \"../ShmuprpgGame.ts\";\nimport {CircularGun} from \"./CircularGun.ts\";\nimport {Pathfinder} from \"../ia/services/Pathfinder.ts\";\nimport * as b3 from \"../ia/decisions/b3.ts\";\n\nexport class Bunny extends Phaser.Sprite {\n\n    birdExplosion: Phaser.Sprite;\n    pathfinder: Pathfinder;\n    blackboard: BunnyBlackboard;\n    weapon: CircularGun;\n    private damageTween: Phaser.Tween;\n\n    constructor(game: Phaser.Game, pathfinder: Pathfinder) {\n        super(game, 0, 0, 'bunny');\n        this.pathfinder = pathfinder;\n        this.game.physics.enable(this, Phaser.Physics.ARCADE);\n        this.anchor.setTo(0.5, 0.5);\n        this.checkWorldBounds = true;\n        this.outOfBoundsKill = true;\n        this.exists = false;\n        (<ShmuprpgGame>this.game).addSpriteAnimation(this, 'bunny.walk.front', 7);\n        (<ShmuprpgGame>this.game).addSpriteAnimation(this, 'bunny.walk.back', 7);\n        (<ShmuprpgGame>this.game).addSpriteAnimation(this, 'bunny.walk.right', 7);\n        (<ShmuprpgGame>this.game).addSpriteAnimation(this, 'bunny.walk.left', 7);\n        (<ShmuprpgGame>this.game).addSpriteAnimation(this, 'bunny.stand.front', 1);\n        (<ShmuprpgGame>this.game).addSpriteAnimation(this, 'bunny.stand.back', 1);\n        (<ShmuprpgGame>this.game).addSpriteAnimation(this, 'bunny.stand.right', 1);\n        (<ShmuprpgGame>this.game).addSpriteAnimation(this, 'bunny.stand.left', 1);\n        this.birdExplosion = this.game.add.sprite(this.x, this.y, 'bird-explosion');\n        this.birdExplosion.anchor.setTo(0.5, 0.5);\n        this.birdExplosion.exists = false;\n        const explodeAnimation = this.birdExplosion.animations.add('explode');\n        explodeAnimation.killOnComplete = true;\n        this.weapon = new CircularGun(this.game);\n    }\n\n    static preload(game: Phaser.Game) {\n        game.load.atlasXML('bunny', 'sprites/lpc/bunny/bunny.png', 'sprites/lpc/bunny/bunny.xml');\n    }\n\n    appears(fromX: number, fromY: number) {\n        const beforeBunny = this.game.add.sprite(fromX, fromY, 'before-bird');\n        beforeBunny.anchor.setTo(0.5, 0.5);\n        const beforeBunnyAnimation = beforeBunny.animations.add('appears');\n        beforeBunnyAnimation.onComplete.add(() => {\n            beforeBunny.destroy();\n            this.reset(fromX, fromY, 10);\n            this.blackboard = new BunnyBlackboard();\n        });\n        beforeBunnyAnimation.play(4, false);\n    }\n\n    update() {\n        super.update();\n        if (this.exists) {\n            this.executeBehaviorTree();\n        }\n    }\n\n    private executeBehaviorTree() {\n        BunnyB3.get().tick(this, this.blackboard);\n    }\n\n    damage(amount: number): Phaser.Sprite {\n        super.damage(amount);\n        if (!this.damageTween) {\n            this.damageTween = this.game.add.tween(this).from({ tint: 0xFF0000 }).to({ tint: 0xFFFFFF }, 500, Phaser.Easing.Linear.None, true, 0, 4, false);\n            this.damageTween.onComplete.add((): void => this.damageTween = null);\n        }\n        this.blackboard.fearLevel = 60;\n        return this;\n    }\n\n    kill(): Phaser.Sprite {\n        super.kill();\n        if(this.damageTween) {\n            this.damageTween.stop(true);\n        }\n        this.birdExplosion.reset(this.x, this.y);\n        this.birdExplosion.play('explode', 8, false);\n        return this;\n    }\n}\n\nclass BunnyBlackboard extends b3.Blackboard {\n    currentPathPointTarget: Phaser.Point;\n    path: Array<Phaser.Point>;\n    fearLevel = 60;\n}\n\nclass BunnyB3 extends b3.Tree<Bunny, BunnyBlackboard> {\n\n    private static singleton: BunnyB3;\n    static get() {\n        return this.singleton || (this.singleton = new BunnyB3());\n    }\n\n    constructor() {\n        super();\n        this.root = this.selector(\n            new ActionFollowPath(),\n            this.sequence(new ConditionFeelSafe(), new ActionAttack()),\n            new ActionSearchAPath());\n    }\n}\n\n\nclass ActionFollowPath extends b3.Action<Bunny, BunnyBlackboard> {\n    tick(t: b3.Tick<Bunny, BunnyBlackboard>): b3.NodeState {\n        let me = t.me;\n        let currentPathPointTarget = t.blackboard.currentPathPointTarget;\n        if (currentPathPointTarget) {\n            this.moveToXY(me, currentPathPointTarget.x, currentPathPointTarget.y, 300);\n            if (Phaser.Math.distance(me.body.center.x, me.body.center.y, currentPathPointTarget.x, currentPathPointTarget.y) < me.body.halfWidth) {\n                t.blackboard.currentPathPointTarget = null;\n            }\n        } else {\n            let path = t.blackboard.path || [];\n            t.blackboard.currentPathPointTarget = path.shift();\n            if (path.length == 0) {\n                me.body.velocity.x = 0;\n                me.body.velocity.y = 0;\n                return b3.NodeState.FAILURE;\n            }\n        }\n        this.animate(me);\n        return b3.NodeState.RUNNING;\n    }\n\n    animate(me: Bunny) {\n        if (Math.abs(me.body.velocity.x) > Math.abs(me.body.velocity.y)) {\n            if (me.body.velocity.x < 0) {\n                me.play(\"bunny.walk.left\", 8, false);\n            } else if (me.body.velocity.x > 0) {\n                me.play(\"bunny.walk.right\", 8, false);\n            } else if (me.body.velocity.y < 0) {\n                me.play(\"bunny.walk.back\", 8, false);\n            } else if (me.body.velocity.y > 0) {\n                me.play(\"bunny.walk.front\", 8, false);\n            } else {\n                me.play(\"bunny.stand.front\", 0, false);\n            }\n        } else {\n            if (me.body.velocity.y < 0) {\n                me.play(\"bunny.walk.back\", 8, false);\n            } else if (me.body.velocity.y > 0) {\n                me.play(\"bunny.walk.front\", 8, false);\n            } else if (me.body.velocity.x < 0) {\n                me.play(\"bunny.walk.left\", 8, false);\n            } else if (me.body.velocity.x > 0) {\n                me.play(\"bunny.walk.right\", 8, false);\n            } else {\n                me.play(\"bunny.stand.front\", 0, false);\n            }\n        }\n    }\n\n    moveToXY(me: Bunny, x: number, y: number, speed: number = 60) {\n        var angle = Math.atan2(y - me.body.center.y, x - me.body.center.x);\n        me.body.velocity.x = Math.cos(angle) * speed;\n        me.body.velocity.y = Math.sin(angle) * speed;\n    }\n}\n\nclass ActionSearchAPath extends b3.Action<Bunny, BunnyBlackboard> {\n\n    thinking = new b3.BlackboardKey<boolean>();\n\n    tick(t: b3.Tick<Bunny, BunnyBlackboard>): b3.NodeState {\n        let thinking = t.blackboard.get(this.thinking) || false;\n        let me = t.me;\n        if (!thinking) {\n            t.blackboard.set(this.thinking, true);\n            let targetPos = me.pathfinder.randomWalkablePos();\n            me.pathfinder.findPath(me.body.center.x, me.body.center.y, targetPos.x, targetPos.y, (path: Phaser.Point[]) => {\n                t.blackboard.path = path || [];\n                t.blackboard.set(this.thinking, false);\n            });\n        }\n        let path = t.blackboard.path || [];\n        return path.length > 0 ? b3.NodeState.SUCCESS : b3.NodeState.RUNNING;\n    }\n}\n\nclass ConditionFeelSafe extends b3.Action<Bunny, BunnyBlackboard>  {\n    tick(t: b3.Tick<Bunny, BunnyBlackboard>): b3.NodeState {\n        let fearLevel = t.blackboard.fearLevel > 0 ? t.blackboard.fearLevel-- : 0;\n        if (fearLevel == 0) {\n            return b3.NodeState.SUCCESS;\n        }\n        if (fearLevel == 60) {\n            return b3.NodeState.FAILURE;\n        }\n        return b3.NodeState.RUNNING;\n    }\n}\n\nclass ActionAttack extends b3.Action<Bunny, BunnyBlackboard> {\n    tick(t: b3.Tick<Bunny, BunnyBlackboard>): b3.NodeState {\n        t.me.weapon.fire(t.me.centerX, t.me.centerY);\n        return b3.NodeState.RUNNING;\n    }\n}","/// <reference path=\"../../typings/phaser.d.ts\"/>\nimport {Bullet} from \"./Bullet.ts\";\n\nexport class CircularGun extends Phaser.Group {\n\n    bulletSpeed = 300;\n    fireRate = 800;\n    nextFireTime = 0;\n    bulletsByShots: number;\n\n    constructor(game: Phaser.Game, maxBullets: number = 64, bulletsByShots = 8) {\n        super(game);\n        this.bulletsByShots = bulletsByShots;\n        for (let i = 0; i < maxBullets; ++i) {\n            this.add(this.createBullet());\n        }\n    }\n\n    createBullet(): Bullet {\n        return new Bullet(this.game);\n    }\n\n    fire(fromX: number, fromY: number) {\n        if (this.game.time.time >= this.nextFireTime) {\n            for (let b = 1; b <= this.bulletsByShots; ++b) {\n                const bullet = <Bullet>this.getFirstExists(false);\n                if (bullet) {\n                    bullet.fire(fromX, fromY, b * 2 * Math.PI / this.bulletsByShots, this.bulletSpeed, 0, 0);\n                }\n            }\n            this.nextFireTime = this.game.time.time + this.fireRate;\n        }\n    }\n}","/// <reference path=\"../../typings/phaser.d.ts\"/>\nimport {Level} from \"../states/Level.ts\";\nimport {Pathfinder} from \"../ia/services/Pathfinder.ts\";\nimport * as b3 from \"../ia/decisions/b3.ts\";\n\nexport class Grobelin extends Phaser.Sprite {\n\n    grobelinDeath: Phaser.Sprite;\n    enemy: Phaser.Sprite;\n    pathfinder: Pathfinder;\n    private attackAnimation: Phaser.Animation;\n    private attackDangerousOffset: Phaser.Point;\n    private damageTween: Phaser.Tween;\n    private blackboard: GrobelinBlackboard;\n\n    constructor(game: Phaser.Game, pathfinder: Pathfinder) {\n        super(game, 0, 0, 'grobelin');\n        this.exists = false;\n        this.pathfinder = pathfinder;\n        this.game.physics.enable(this, Phaser.Physics.ARCADE);\n        this.anchor.setTo(0.5, 0.5);\n        this.checkWorldBounds = true;\n        this.outOfBoundsKill = true;\n        this.grobelinDeath = this.game.add.sprite(this.x, this.y, 'grobelin');\n        this.grobelinDeath.anchor.setTo(0.5, 0.5);\n        this.grobelinDeath.exists = false;\n    }\n\n    appears(fromX: number, fromY: number, target: Phaser.Sprite) {\n        const beforeGrobelin = this.game.add.sprite(fromX, fromY, 'before-bird');\n        beforeGrobelin.anchor.setTo(0.5, 0.5);\n        const beforeGrobelinAnimation = beforeGrobelin.animations.add('appears');\n        beforeGrobelinAnimation.onComplete.add(() => {\n            beforeGrobelin.destroy();\n            this.reset(fromX, fromY, 20);\n            this.body.setSize(16, 16, 24, 48);\n            this.body.collideWorldBounds = true;\n            this.blackboard = new GrobelinBlackboard();\n            this.enemy = target;\n        });\n        beforeGrobelinAnimation.play(4, false);\n    }\n\n    kill(): Phaser.Sprite {\n        super.kill();\n        if (this.damageTween) {\n            this.damageTween.stop(true);\n        }\n        this.tint = 0xFFFFFF;\n        this.grobelinDeath.reset(this.x, this.y);\n        this.grobelinDeath.animations.play(\"lpc.hurt\", 6, false).killOnComplete = true;\n        return this;\n    }\n\n    update() {\n        super.update();\n        if (this.exists) {\n            this.executeBehaviorTree();\n        }\n    }\n\n    damage(amount: number): Phaser.Sprite {\n        if (!this.damageTween) {\n            this.damageTween = this.game.add.tween(this).from({ tint: 0xFF0000 }).to({ tint: 0xFFFFFF }, 500, Phaser.Easing.Linear.None, true, 0, 4, false);\n            this.damageTween.onComplete.add((): void => this.damageTween = null);\n        }\n        super.damage(amount);\n        return this;\n    }\n\n    private executeBehaviorTree() {\n        GrobelinB3.get().tick(this, this.blackboard);\n    }\n\n    attackEnemy(): boolean {\n        this.body.velocity.x = 0;\n        this.body.velocity.y = 0;\n        if (!this.attackAnimation) {\n            [this.attackAnimation, this.attackDangerousOffset] = this.playAttackEnemyAnimation();\n        } else if (this.attackAnimation.isFinished) {\n            this.attackAnimation = null;\n            const enemyRectangle = new Phaser.Rectangle(this.enemy.left, this.enemy.top, this.enemy.width, this.enemy.height);\n            if (Phaser.Rectangle.containsPoint(enemyRectangle, this.getAttackPoint())) {\n                this.enemy.damage(1);\n            }\n        }\n        return true;\n    }\n\n    getAttackPoint(): Phaser.Point {\n        if (this.attackDangerousOffset) {\n            return new Phaser.Point(this.body.center.x + this.attackDangerousOffset.x, this.body.center.y + this.attackDangerousOffset.y);\n        } else {\n            return null;\n        }\n    }\n\n    private playAttackEnemyAnimation(): [Phaser.Animation, Phaser.Point] {\n        const dx = this.enemy.body.center.x - this.body.center.x;\n        const dy = this.enemy.body.center.y - this.body.center.y;\n        if (Math.abs(dx) > Math.abs(dy)) {\n            if (dx < 0) {\n                return [this.play(\"lpc.thrust.left\", 8, false), new Phaser.Point(-24, -16)];\n            } else if (dx > 0) {\n                return [this.play(\"lpc.thrust.right\", 8, false), new Phaser.Point(24, -16)];\n            } else if (dy < 0) {\n                return [this.play(\"lpc.thrust.back\", 8, false), new Phaser.Point(8, -48)];\n            } else if (dy > 0) {\n                return [this.play(\"lpc.thrust.front\", 8, false), new Phaser.Point(-8, 8)];\n            } else {\n                return [this.play(\"lpc.thrust.right\", 8, false), new Phaser.Point(24, -16)];\n            }\n        } else {\n            if (dy < 0) {\n                return [this.play(\"lpc.thrust.back\", 8, false), new Phaser.Point(8, -48)];\n            } else if (dy > 0) {\n                return [this.play(\"lpc.thrust.front\", 8, false), new Phaser.Point(-8, 8)];\n            } else if (dx < 0) {\n                return [this.play(\"lpc.thrust.left\", 8, false), new Phaser.Point(-24, -16)];\n            } else if (dx > 0) {\n                return [this.play(\"lpc.thrust.right\", 8, false), new Phaser.Point(24, -16)];\n            } else {\n                return [this.play(\"lpc.thrust.back\", 8, false), new Phaser.Point(8, -48)];\n            }\n        }\n    }\n}\n\nclass GrobelinBlackboard extends b3.Blackboard {\n    currentPathPointTarget: Phaser.Point;\n    path: Array<Phaser.Point>;\n}\n\nclass GrobelinB3 extends b3.Tree<Grobelin, GrobelinBlackboard> {\n\n    private static singleton: GrobelinB3;\n    static get() {\n        return this.singleton || (this.singleton = new GrobelinB3());\n    }\n\n    constructor() {\n        super();\n        this.root = this.selector(\n            this.sequence(new ConditionIsNearEnemy(), new ActionAttackEnemy()),\n            new ActionFollowPath(),\n            new ActionSearchAPathToEnemy());\n    }\n}\n\nclass ActionFollowPath extends b3.Action<Grobelin, GrobelinBlackboard> {\n    tick(t: b3.Tick<Grobelin, GrobelinBlackboard>): b3.NodeState {\n        let me = t.me;\n        let currentPathPointTarget = t.blackboard.currentPathPointTarget;\n        if (currentPathPointTarget) {\n            this.moveToXY(me, currentPathPointTarget.x, currentPathPointTarget.y, 300);\n            if (Phaser.Math.distance(me.body.center.x, me.body.center.y, currentPathPointTarget.x, currentPathPointTarget.y) < me.body.halfWidth) {\n                t.blackboard.currentPathPointTarget = null;\n            }\n        } else {\n            let path = t.blackboard.path || [];\n            t.blackboard.currentPathPointTarget = path.shift();\n            if (path.length == 0) {\n                me.body.velocity.x = 0;\n                me.body.velocity.y = 0;\n                return b3.NodeState.FAILURE;\n            }\n        }\n        this.animate(me);\n        return b3.NodeState.RUNNING;\n    }\n\n    animate(me: Grobelin) {\n        if (Math.abs(me.body.velocity.x) > Math.abs(me.body.velocity.y)) {\n            if (me.body.velocity.x < 0) {\n                me.play(\"lpc.walk.left\", 8, false);\n            } else if (me.body.velocity.x > 0) {\n                me.play(\"lpc.walk.right\", 8, false);\n            } else if (me.body.velocity.y < 0) {\n                me.play(\"lpc.walk.back\", 8, false);\n            } else if (me.body.velocity.y > 0) {\n                me.play(\"lpc.walk.front\", 8, false);\n            } else {\n                me.play(\"lpc.hurt\", 0, false);\n            }\n        } else {\n            if (me.body.velocity.y < 0) {\n                me.play(\"lpc.walk.back\", 8, false);\n            } else if (me.body.velocity.y > 0) {\n                me.play(\"lpc.walk.front\", 8, false);\n            } else if (me.body.velocity.x < 0) {\n                me.play(\"lpc.walk.left\", 8, false);\n            } else if (me.body.velocity.x > 0) {\n                me.play(\"lpc.walk.right\", 8, false);\n            } else {\n                me.play(\"lpc.hurt\", 0, false);\n            }\n        }\n    }\n\n    moveToXY(me: Grobelin, x: number, y: number, speed: number = 60) {\n        var angle = Math.atan2(y - me.body.center.y, x - me.body.center.x);\n        me.body.velocity.x = Math.cos(angle) * speed;\n        me.body.velocity.y = Math.sin(angle) * speed;\n    }\n}\n\nclass ActionSearchAPathToEnemy extends b3.Action<Grobelin, GrobelinBlackboard> {\n\n    thinking = new b3.BlackboardKey<boolean>();\n\n    tick(t: b3.Tick<Grobelin, GrobelinBlackboard>): b3.NodeState {\n        let thinking = t.blackboard.get(this.thinking) || false;\n        let me = t.me;\n        if (!thinking) {\n            t.blackboard.set(this.thinking, true);\n            me.pathfinder.findPath(me.body.center.x, me.body.center.y, me.enemy.body.center.x, me.enemy.body.center.y, (path: Phaser.Point[]) => {\n                t.blackboard.path = path || [];\n                t.blackboard.set(this.thinking, false);\n            });\n        }\n        let path = t.blackboard.path || [];\n        return path.length > 0 ? b3.NodeState.SUCCESS : b3.NodeState.RUNNING;\n    }\n}\n\nclass ConditionIsNearEnemy extends b3.Condition<Grobelin, GrobelinBlackboard> {\n    check(t: b3.Tick<Grobelin, GrobelinBlackboard>): boolean {\n        let me = t.me;\n        return me.enemy && Phaser.Math.distance(me.body.center.x, me.body.center.y, me.enemy.body.center.x, me.enemy.body.center.y) < me.body.width * 2;\n    }\n}\n\nclass ActionAttackEnemy extends b3.Action<Grobelin, GrobelinBlackboard> {\n    tick(t: b3.Tick<Grobelin, GrobelinBlackboard>): b3.NodeState {\n        if (t.me.attackEnemy()) {\n            return b3.NodeState.SUCCESS;\n        } else {\n            return b3.NodeState.RUNNING;\n        }\n    }\n}","/// <reference path=\"../../typings/phaser.d.ts\"/>\nimport {Grobelin} from \"./Grobelin.ts\";\nimport { ShmuprpgGame } from \"../ShmuprpgGame.ts\";\nimport { Level } from \"../states/Level.ts\";\nimport { Pathfinder } from \"../ia/services/Pathfinder.ts\";\n\nexport class GrobelinHorde extends Phaser.Group {\n\n    appearsRate = 10000;\n    target: Phaser.Sprite;\n    private nextAppearsTime = 0;\n    private pathfinder: Pathfinder;\n\n    constructor(target: Phaser.Sprite, pathFinder: Pathfinder, maxGrobelins: number = 4) {\n        super(target.game);\n        this.pathfinder = pathFinder;\n        this.reset(target, maxGrobelins);\n    }\n\n    reset(target: Phaser.Sprite, maxGrobelins: number = 4) {\n        this.target = target;\n        this.removeAll();\n        for (let i = 0; i < maxGrobelins; ++i) {\n            this.add(this.createGrobelin());\n        }\n    }\n\n    static preload(game: Phaser.Game) {\n        game.load.atlasXML('grobelin', 'sprites/lpc/characters/grobelin.png', 'sprites/lpc/characters/lpc.xml');\n    }\n\n    update() {\n        super.update();\n        this.appears();\n    }\n\n    private createGrobelin(): Grobelin {\n        const grobelin = new Grobelin(this.game, this.pathfinder);\n        const game = <ShmuprpgGame>this.game;\n        game.addSpriteAnimation(grobelin.grobelinDeath, 'lpc.hurt', 6);\n        game.addSpriteAnimation(grobelin, 'lpc.hurt', 6);\n        game.addSpriteAnimation(grobelin, 'lpc.walk.back', 9);\n        game.addSpriteAnimation(grobelin, 'lpc.walk.front', 9);\n        game.addSpriteAnimation(grobelin, 'lpc.walk.left', 9);\n        game.addSpriteAnimation(grobelin, 'lpc.walk.right', 9);\n        game.addSpriteAnimation(grobelin, 'lpc.thrust.back', 9);\n        game.addSpriteAnimation(grobelin, 'lpc.thrust.front', 9);\n        game.addSpriteAnimation(grobelin, 'lpc.thrust.left', 9);\n        game.addSpriteAnimation(grobelin, 'lpc.thrust.right', 9);\n        return grobelin;\n    }\n\n    private appears() {\n        if (this.game.time.time >= this.nextAppearsTime) {\n            const grobelin = <Grobelin>this.getFirstExists(false);\n            if (grobelin) {\n                const pos = this.pathfinder.randomWalkablePos();\n                grobelin.appears(pos.x, pos.y, this.target);\n                this.nextAppearsTime = this.game.time.time + this.appearsRate;\n            }\n        }\n    }\n}","/// <reference path=\"../../typings/phaser.d.ts\"/>\nimport { ShmuprpgGame } from \"../ShmuprpgGame.ts\";\nimport { CircularGun } from \"./MachineGun.ts\";\nimport { Controls } from \"../utils/Controls.ts\";\nimport {Bullet} from \"./Bullet.ts\";\n\nexport class Hero extends Phaser.Sprite {\n\n    weapon: HeroMachineGun;\n    controls: Controls;\n\n    constructor(game: Phaser.Game) {\n        super(game, game.world.centerX, game.world.centerY, 'tobira');\n        this.health = 3;\n        this.controls = (<ShmuprpgGame>game).controls;\n        (<ShmuprpgGame>game).addSpriteAnimation(this, 'lpc.hurt', 6);\n        (<ShmuprpgGame>game).addSpriteAnimation(this, 'lpc.walk.back', 9);\n        (<ShmuprpgGame>game).addSpriteAnimation(this, 'lpc.walk.front', 9);\n        (<ShmuprpgGame>game).addSpriteAnimation(this, 'lpc.walk.left', 9);\n        (<ShmuprpgGame>game).addSpriteAnimation(this, 'lpc.walk.right', 9);\n        this.play(\"lpc.hurt\", 0, false);\n        this.anchor.setTo(0.5, 0.5);\n        this.game.physics.enable(this, Phaser.Physics.ARCADE);\n        this.body.setSize(16, 16, 24, 48);\n        this.body.collideWorldBounds = true;\n        this.weapon = new HeroMachineGun(this.game);\n        this.game.add.existing(this.weapon);\n    }\n\n    static preload(game: Phaser.Game) {\n        game.load.atlasXML('tobira', 'sprites/lpc/characters/tobira.png', 'sprites/lpc/characters/lpc.xml');\n        game.load.atlasXML('bullets', 'sprites/devnewton/bullets.png', 'sprites/devnewton/bullets.xml');\n    }\n\n    update() {\n        super.update();\n        this.body.velocity.x = 0;\n        this.body.velocity.y = 0;\n\n        if (this.controls.isGoingLeft()) {\n            this.body.velocity.x = -300;\n        } else if (this.controls.isGoingRight()) {\n            this.body.velocity.x = 300;\n        }\n\n        if (this.controls.isGoingUp()) {\n            this.body.velocity.y = -300;\n        } else if (this.controls.isGoingDown()) {\n            this.body.velocity.y = 300;\n        }\n\n        if (this.body.velocity.y < 0) {\n            this.play(\"lpc.walk.back\", 8, false);\n        } else if (this.body.velocity.y > 0) {\n            this.play(\"lpc.walk.front\", 8, false);\n        } else if (this.body.velocity.x < 0) {\n            this.play(\"lpc.walk.left\", 8, false);\n        } else if (this.body.velocity.x > 0) {\n            this.play(\"lpc.walk.right\", 8, false);\n        } else {\n            this.play(\"lpc.hurt\", 0, false);\n        }\n\n        const shootingAngle = this.controls.shootingAngle(this.x, this.y);\n        if (shootingAngle != null) {\n            this.weapon.fire(this.x, this.y, shootingAngle);\n        }\n\n    }\n\n    invincible = false;\n\n    damage(amount: number): Phaser.Sprite {\n        if (!this.invincible) {\n            this.invincible = true;\n            this.game.add.tween(this).from({ tint: 0xFF0000 }).to({ tint: 0xFFFFFF }, 1000, Phaser.Easing.Linear.None, true, 0, 4, false).onComplete.add(() => this.invincible = false);\n            super.damage(amount);\n            if (!this.alive) {\n                this.game.state.start('GameOver')\n            }\n        }\n        return this;\n    }\n}\n\nclass HeroMachineGun extends CircularGun {\n    createBullet(): Bullet {\n        return new Bullet(this.game, 'bullet.blue');\n    }\n}","/// <reference path=\"../../typings/phaser.d.ts\"/>\nimport {Bullet} from \"./Bullet.ts\";\n\nexport class CircularGun extends Phaser.Group {\n\n    bulletSpeed = 600;\n    fireRate = 200;\n    nextFireTime = 0;\n\n    constructor(game: Phaser.Game, maxBullets: number = 64) {\n        super(game);\n        for (let i = 0; i < maxBullets; ++i) {\n            this.add(this.createBullet());\n        }\n    }\n\n    createBullet(): Bullet {\n        return new Bullet(this.game);\n    }\n\n    fire(fromX: number, fromY: number, angle: number) {\n        if (this.game.time.time >= this.nextFireTime) {\n            const bullet = <Bullet>this.getFirstExists(false);\n            if (bullet) {\n                bullet.fire(fromX, fromY, angle, this.bulletSpeed, 0, 0);\n                this.nextFireTime = this.game.time.time + this.fireRate;\n            }\n        }\n    }\n}","/// <reference path=\"../../typings/phaser.d.ts\"/>\nimport {Level} from \"../states/Level.ts\";\nimport {Pathfinder} from \"../ia/services/Pathfinder.ts\";\nimport * as b3 from \"../ia/decisions/b3.ts\";\nimport {CircularGun} from \"./MachineGun.ts\";\n\nexport class Spider extends Phaser.Sprite {\n\n    spiderDeath: Phaser.Sprite;\n    enemy: Phaser.Sprite;\n    pathfinder: Pathfinder;\n    private attackAnimation: Phaser.Animation;\n    private attackDangerousOffset: Phaser.Point;\n    private damageTween: Phaser.Tween;\n    private blackboard: SpiderBlackboard;\n    machineGun: CircularGun;\n\n    constructor(game: Phaser.Game, pathfinder: Pathfinder) {\n        super(game, 0, 0, 'spider');\n        this.exists = false;\n        this.pathfinder = pathfinder;\n        this.game.physics.enable(this, Phaser.Physics.ARCADE);\n        this.anchor.setTo(0.5, 0.5);\n        this.checkWorldBounds = true;\n        this.outOfBoundsKill = true;\n        this.spiderDeath = this.game.add.sprite(this.x, this.y, 'spider');\n        this.spiderDeath.anchor.setTo(0.5, 0.5);\n        this.spiderDeath.exists = false;\n        this.machineGun = new CircularGun(this.game, 1);\n    }\n\n    appears(fromX: number, fromY: number, target: Phaser.Sprite) {\n        const beforeSpider = this.game.add.sprite(fromX, fromY, 'before-bird');\n        beforeSpider.anchor.setTo(0.5, 0.5);\n        const beforeSpiderAnimation = beforeSpider.animations.add('appears');\n        beforeSpiderAnimation.onComplete.add(() => {\n            beforeSpider.destroy();\n            this.reset(fromX, fromY, 10);\n            this.body.setSize(16, 16, 24, 48);\n            this.body.collideWorldBounds = true;\n            this.blackboard = new SpiderBlackboard();\n            this.enemy = target;\n        });\n        beforeSpiderAnimation.play(4, false);\n    }\n\n    kill(): Phaser.Sprite {\n        super.kill();\n        this.damageTween.stop(true);\n        this.tint = 0xFFFFFF;\n        this.spiderDeath.reset(this.x, this.y);\n        this.spiderDeath.animations.play(\"spider.hurt\", 6, false).killOnComplete = true;\n        return this;\n    }\n\n    update() {\n        super.update();\n        if (this.exists) {\n            this.executeBehaviorTree();\n        }\n    }\n\n    damage(amount: number): Phaser.Sprite {\n        if (!this.damageTween) {\n            this.damageTween = this.game.add.tween(this).from({ tint: 0xFF0000 }).to({ tint: 0xFFFFFF }, 500, Phaser.Easing.Linear.None, true, 0, 4, false);\n            this.damageTween.onComplete.add((): void => this.damageTween = null);\n        }\n        super.damage(amount);\n        return this;\n    }\n\n    private executeBehaviorTree() {\n        SpiderB3.get().tick(this, this.blackboard);\n    }\n\n    attackEnemy(): boolean {\n        this.body.velocity.x = 0;\n        this.body.velocity.y = 0;\n        if (!this.attackAnimation) {\n            [this.attackAnimation, this.attackDangerousOffset] = this.playAttackEnemyAnimation();\n        } else if (this.attackAnimation.isFinished) {\n            this.attackAnimation = null;\n            const enemyRectangle = new Phaser.Rectangle(this.enemy.left, this.enemy.top, this.enemy.width, this.enemy.height);\n            if (Phaser.Rectangle.containsPoint(enemyRectangle, this.getAttackPoint())) {\n                this.enemy.damage(1);\n            }\n        }\n        return true;\n    }\n\n    fire(): boolean {\n        this.body.velocity.x = 0;\n        this.body.velocity.y = 0;\n        let [_, fireOffset] = this.playFireAnimation();\n        let angle = Phaser.Math.angleBetween(this.body.center.x, this.body.center.y, this.enemy.body.center.x, this.enemy.body.center.y);\n        this.machineGun.fire(this.body.center.x + fireOffset.x, this.body.center.y + fireOffset.y, angle);\n        return true;\n    }\n\n    private playFireAnimation(): [Phaser.Animation, Phaser.Point] {\n        const dx = this.enemy.body.center.x - this.body.center.x;\n        const dy = this.enemy.body.center.y - this.body.center.y;\n        if (Math.abs(dx) > Math.abs(dy)) {\n            if (dx < 0) {\n                return [this.play(\"spider.stand.left\", 6, false), new Phaser.Point(-24, -16)];\n            } else if (dx > 0) {\n                return [this.play(\"spider.stand.right\", 6, false), new Phaser.Point(24, -16)];\n            } else if (dy < 0) {\n                return [this.play(\"spider.stand.back\", 6, false), new Phaser.Point(8, -48)];\n            } else if (dy > 0) {\n                return [this.play(\"spider.stand.front\", 6, false), new Phaser.Point(-8, 8)];\n            } else {\n                return [this.play(\"spider.stand.right\", 6, false), new Phaser.Point(24, -16)];\n            }\n        } else {\n            if (dy < 0) {\n                return [this.play(\"spider.stand.back\", 8, false), new Phaser.Point(8, -48)];\n            } else if (dy > 0) {\n                return [this.play(\"spider.stand.front\", 8, false), new Phaser.Point(-8, 8)];\n            } else if (dx < 0) {\n                return [this.play(\"spider.stand.left\", 8, false), new Phaser.Point(-24, -16)];\n            } else if (dx > 0) {\n                return [this.play(\"spider.stand.right\", 8, false), new Phaser.Point(24, -16)];\n            } else {\n                return [this.play(\"spider.stand.back\", 8, false), new Phaser.Point(8, -48)];\n            }\n        }\n    }\n\n    private getAttackPoint(): Phaser.Point {\n        if (this.attackDangerousOffset) {\n            return new Phaser.Point(this.body.center.x + this.attackDangerousOffset.x, this.body.center.y + this.attackDangerousOffset.y);\n        } else {\n            return null;\n        }\n    }\n\n    private playAttackEnemyAnimation(): [Phaser.Animation, Phaser.Point] {\n        const dx = this.enemy.body.center.x - this.body.center.x;\n        const dy = this.enemy.body.center.y - this.body.center.y;\n        if (Math.abs(dx) > Math.abs(dy)) {\n            if (dx < 0) {\n                return [this.play(\"spider.attack.left\", 8, false), new Phaser.Point(-24, -16)];\n            } else if (dx > 0) {\n                return [this.play(\"spider.attack.right\", 8, false), new Phaser.Point(24, -16)];\n            } else if (dy < 0) {\n                return [this.play(\"spider.attack.back\", 8, false), new Phaser.Point(8, -48)];\n            } else if (dy > 0) {\n                return [this.play(\"spider.attack.front\", 8, false), new Phaser.Point(-8, 8)];\n            } else {\n                return [this.play(\"spider.attack.right\", 8, false), new Phaser.Point(24, -16)];\n            }\n        } else {\n            if (dy < 0) {\n                return [this.play(\"spider.attack.back\", 8, false), new Phaser.Point(8, -48)];\n            } else if (dy > 0) {\n                return [this.play(\"spider.attack.front\", 8, false), new Phaser.Point(-8, 8)];\n            } else if (dx < 0) {\n                return [this.play(\"spider.attack.left\", 8, false), new Phaser.Point(-24, -16)];\n            } else if (dx > 0) {\n                return [this.play(\"spider.attack.right\", 8, false), new Phaser.Point(24, -16)];\n            } else {\n                return [this.play(\"spider.attack.back\", 8, false), new Phaser.Point(8, -48)];\n            }\n        }\n    }\n}\n\nclass SpiderBlackboard extends b3.Blackboard {\n    currentPathPointTarget: Phaser.Point;\n    path: Array<Phaser.Point>;\n}\n\nclass SpiderB3 extends b3.Tree<Spider, SpiderBlackboard> {\n\n    private static singleton: SpiderB3;\n    static get() {\n        return this.singleton || (this.singleton = new SpiderB3());\n    }\n\n    constructor() {\n        super();\n        this.root = this.selector(\n            this.sequence(new ConditionIsNearEnemy(), new ActionAttackEnemy()),\n            this.sequence(new ConditionIsEnemyInLineOfFire(), new ActionFire()),\n            new ActionFollowPath(),\n            new ActionSearchAPathToEnemy());\n    }\n}\n\nclass ActionFollowPath extends b3.Action<Spider, SpiderBlackboard> {\n    tick(t: b3.Tick<Spider, SpiderBlackboard>): b3.NodeState {\n        let me = t.me;\n        let currentPathPointTarget = t.blackboard.currentPathPointTarget;\n        if (currentPathPointTarget) {\n            this.moveToXY(me, currentPathPointTarget.x, currentPathPointTarget.y, 300);\n            if (Phaser.Math.distance(me.body.center.x, me.body.center.y, currentPathPointTarget.x, currentPathPointTarget.y) < me.body.halfWidth) {\n                t.blackboard.currentPathPointTarget = null;\n            }\n        } else {\n            let path = t.blackboard.path || [];\n            t.blackboard.currentPathPointTarget = path.shift();\n            if (path.length == 0) {\n                me.body.velocity.x = 0;\n                me.body.velocity.y = 0;\n                return b3.NodeState.FAILURE;\n            }\n        }\n        this.animate(me);\n        return b3.NodeState.RUNNING;\n    }\n\n    animate(me: Spider) {\n        if (Math.abs(me.body.velocity.x) > Math.abs(me.body.velocity.y)) {\n            if (me.body.velocity.x < 0) {\n                me.play(\"spider.walk.left\", 8, false);\n            } else if (me.body.velocity.x > 0) {\n                me.play(\"spider.walk.right\", 8, false);\n            } else if (me.body.velocity.y < 0) {\n                me.play(\"spider.walk.back\", 8, false);\n            } else if (me.body.velocity.y > 0) {\n                me.play(\"spider.walk.front\", 8, false);\n            } else {\n                me.play(\"spider.hurt\", 0, false);\n            }\n        } else {\n            if (me.body.velocity.y < 0) {\n                me.play(\"spider.walk.back\", 8, false);\n            } else if (me.body.velocity.y > 0) {\n                me.play(\"spider.walk.front\", 8, false);\n            } else if (me.body.velocity.x < 0) {\n                me.play(\"spider.walk.left\", 8, false);\n            } else if (me.body.velocity.x > 0) {\n                me.play(\"spider.walk.right\", 8, false);\n            } else {\n                me.play(\"lpc.hurt\", 0, false);\n            }\n        }\n    }\n\n    moveToXY(me: Spider, x: number, y: number, speed: number = 60) {\n        var angle = Math.atan2(y - me.body.center.y, x - me.body.center.x);\n        me.body.velocity.x = Math.cos(angle) * speed;\n        me.body.velocity.y = Math.sin(angle) * speed;\n    }\n}\n\nclass ActionSearchAPathToEnemy extends b3.Action<Spider, SpiderBlackboard> {\n\n    thinking = new b3.BlackboardKey<boolean>();\n\n    tick(t: b3.Tick<Spider, SpiderBlackboard>): b3.NodeState {\n        let thinking = t.blackboard.get(this.thinking) || false;\n        let me = t.me;\n        if (!thinking) {\n            t.blackboard.set(this.thinking, true);\n            me.pathfinder.findPath(me.body.center.x, me.body.center.y, me.enemy.body.center.x, me.enemy.body.center.y, (path: Phaser.Point[]) => {\n                t.blackboard.path = path || [];\n                t.blackboard.set(this.thinking, false);\n            });\n        }\n        let path = t.blackboard.path || [];\n        return path.length > 0 ? b3.NodeState.SUCCESS : b3.NodeState.RUNNING;\n    }\n}\n\nclass ConditionIsEnemyInLineOfFire extends b3.Condition<Spider, SpiderBlackboard> {\n    check(t: b3.Tick<Spider, SpiderBlackboard>): boolean {\n        let me = t.me;\n        if (me.enemy) {\n            const epsilon = 10 * Phaser.Math.PI2 / 360;\n            let angle = Phaser.Math.angleBetween(me.body.center.x, me.body.center.y, me.enemy.body.center.x, me.enemy.body.center.y);\n            angle = Phaser.Math.normalizeAngle(angle);\n            if (Phaser.Math.fuzzyEqual(angle, Phaser.Math.PI2, epsilon)) {\n                return true;\n            }\n            if (Phaser.Math.fuzzyEqual(angle, Math.PI / 2, epsilon)) {\n                return true;\n            }\n            if (Phaser.Math.fuzzyEqual(angle, Math.PI, epsilon)) {\n                return true;\n            }\n            if (Phaser.Math.fuzzyEqual(angle, 3 * Math.PI / 2, epsilon)) {\n                return true;\n            }\n\n        }\n        return false;\n    }\n}\n\nclass ActionFire extends b3.Action<Spider, SpiderBlackboard> {\n    tick(t: b3.Tick<Spider, SpiderBlackboard>): b3.NodeState {\n        t.me.fire();\n        return b3.NodeState.RUNNING;\n    }\n}\n\nclass ConditionIsNearEnemy extends b3.Condition<Spider, SpiderBlackboard> {\n    check(t: b3.Tick<Spider, SpiderBlackboard>): boolean {\n        let me = t.me;\n        return me.enemy && Phaser.Math.distance(me.body.center.x, me.body.center.y, me.enemy.body.center.x, me.enemy.body.center.y) < me.body.width * 2;\n    }\n}\n\nclass ActionAttackEnemy extends b3.Action<Spider, SpiderBlackboard> {\n    tick(t: b3.Tick<Spider, SpiderBlackboard>): b3.NodeState {\n        if (t.me.attackEnemy()) {\n            return b3.NodeState.SUCCESS;\n        } else {\n            return b3.NodeState.RUNNING;\n        }\n    }\n}\n\n","/// <reference path=\"../../typings/phaser.d.ts\"/>\nimport {Spider} from \"./Spider.ts\";\nimport { ShmuprpgGame } from \"../ShmuprpgGame.ts\";\nimport { Level } from \"../states/Level.ts\";\nimport { Pathfinder } from \"../ia/services/Pathfinder.ts\";\n\nexport class SpiderHorde extends Phaser.Group {\n\n    appearsRate = 10000;\n    target: Phaser.Sprite;\n    private nextAppearsTime = 0;\n    private pathfinder: Pathfinder;\n\n    constructor(target: Phaser.Sprite, pathFinder: Pathfinder, maxSpiders: number = 4) {\n        super(target.game);\n        this.pathfinder = pathFinder;\n        this.reset(target, maxSpiders);\n\n    }\n\n    reset(target: Phaser.Sprite, maxSpiders: number = 4) {\n        this.target = target;\n        this.removeAll();\n        for (let i = 0; i < maxSpiders; ++i) {\n            this.add(this.createSpider());\n        }\n    }\n\n    static preload(game: Phaser.Game) {\n        game.load.atlasXML('spider', 'sprites/lpc/spiders/spider01.png', 'sprites/lpc/spiders/spider.xml');\n    }\n\n    update() {\n        super.update();\n        this.appears();\n    }\n\n    private createSpider(): Spider {\n        const spider = new Spider(this.game, this.pathfinder);\n        const game = <ShmuprpgGame>this.game;\n        game.addSpriteAnimation(spider.spiderDeath, 'spider.hurt', 6);\n        game.addSpriteAnimation(spider, 'spider.stand.back', 6);\n        game.addSpriteAnimation(spider, 'spider.stand.front', 6);\n        game.addSpriteAnimation(spider, 'spider.stand.left', 6);\n        game.addSpriteAnimation(spider, 'spider.stand.right', 6);\n        game.addSpriteAnimation(spider, 'spider.walk.back', 9);\n        game.addSpriteAnimation(spider, 'spider.walk.front', 9);\n        game.addSpriteAnimation(spider, 'spider.walk.left', 9);\n        game.addSpriteAnimation(spider, 'spider.walk.right', 9);\n        game.addSpriteAnimation(spider, 'spider.attack.back', 9);\n        game.addSpriteAnimation(spider, 'spider.attack.front', 9);\n        game.addSpriteAnimation(spider, 'spider.attack.left', 9);\n        game.addSpriteAnimation(spider, 'spider.attack.right', 9);\n        return spider;\n    }\n\n    private appears() {\n        if (this.game.time.time >= this.nextAppearsTime) {\n            const spider = <Spider>this.getFirstExists(false);\n            if (spider) {\n                const pos = this.pathfinder.randomWalkablePos();\n                spider.appears(pos.x, pos.y, this.target);\n                this.nextAppearsTime = this.game.time.time + this.appearsRate;\n            }\n        }\n    }\n}","export class Tree<ME, BB extends Blackboard> {\n    root: Node<ME,BB>;\n\n    tick(me: ME, blackboard: BB) {\n        const t = new Tick(me, blackboard);\n        this.root.tick(t);\n    }\n\n    sequence(...children: Node<ME,BB>[]): Sequence<ME,BB> {\n        return new Sequence<ME,BB>(...children);\n    }\n\n    selector(...children: Node<ME,BB>[]): Sequence<ME,BB> {\n        return new Selector<ME,BB>(...children);\n    }\n\n    parallel(...children: Node<ME,BB>[]): Sequence<ME,BB> {\n        return new Parallel<ME,BB>(...children);\n    }\n}\n\nexport class BlackboardKey<T> {\n    id = Symbol();\n}\n\nexport class Blackboard {\n    data = {};\n    \n    get<T>(k: BlackboardKey<T>): T {\n        return <T>this.data[k.id];\n    }\n    set<T>(k: BlackboardKey<T>, value: T) {\n        this.data[k.id] = value;\n    }\n    reset() {\n        this.data = {};\n    }\n}\n\nexport class Tick<ME, BB> {\n    me: ME;\n    blackboard: BB;\n\n    constructor(me: ME, b: BB) {\n        this.blackboard = b;\n        this.me = me;\n    }\n}\n\nexport enum NodeState {\n    SUCCESS, FAILURE, RUNNING\n}\n\nexport abstract class Node<ME,BB> {\n\n    abstract tick(t: Tick<ME,BB>): NodeState;\n}\n\n\nexport abstract class Branch<ME,BB> extends Node<ME,BB> {\n    children: Node<ME,BB>[];\n    constructor(...children: Node<ME,BB>[]) {\n        super();\n        this.children = children;\n    }\n\n}\n\nexport abstract class Leaf<ME,BB> extends Node<ME,BB> {\n\n}\n\nexport class Selector<ME,BB> extends Branch<ME,BB> {\n\n    constructor(...children: Node<ME,BB>[]) {\n        super(...children);\n    }\n    tick(t: Tick<ME,BB>): NodeState {\n        for (let c of this.children) {\n            switch (c.tick(t)) {\n                case NodeState.SUCCESS:\n                    return NodeState.SUCCESS;\n                case NodeState.RUNNING:\n                    return NodeState.RUNNING;\n            }\n        }\n        return NodeState.FAILURE;\n    }\n}\n\nexport class Sequence<ME,BB> extends Branch<ME,BB> {\n\n    constructor(...children: Node<ME,BB>[]) {\n        super(...children);\n    }\n    tick(t: Tick<ME,BB>): NodeState {\n        for (let c of this.children) {\n            switch (c.tick(t)) {\n                case NodeState.FAILURE:\n                    return NodeState.FAILURE;\n                case NodeState.RUNNING:\n                    return NodeState.RUNNING;\n            }\n        }\n        return NodeState.SUCCESS;\n    }\n}\n\nexport class Parallel<ME,BB> extends Branch<ME,BB> {\n    successThreshold: number;\n    failureThreshold: number;\n\n    constructor(...children: Node<ME,BB>[]) {\n        super(...children);\n    }\n\n    tick(t: Tick<ME,BB>): NodeState {\n        let failures = 0, successes = 0;\n        for (let c of this.children) {\n            switch (c.tick(t)) {\n                case NodeState.FAILURE:\n                    return ++failures;\n                case NodeState.SUCCESS:\n                    return ++successes;\n            }\n        }\n        if (successes >= this.successThreshold) {\n            return NodeState.SUCCESS;\n        } else if (failures >= this.failureThreshold) {\n            return NodeState.FAILURE;\n        } else {\n            return NodeState.RUNNING;\n        }\n    }\n}\n\nexport abstract class Decorator<ME,BB> extends Node<ME,BB> {\n    child: Node<ME,BB>;\n\n    constructor(child: Node<ME,BB>) {\n        super();\n        this.child = child;\n    }\n}\n\nexport abstract class Action<ME,BB> extends Leaf<ME,BB> {\n\n}\n\nexport abstract class Condition<ME,BB> extends Leaf<ME,BB> {\n\n    abstract check(t: Tick<ME,BB>): boolean;\n\n    tick(t: Tick<ME,BB>): NodeState {\n        if (this.check(t)) {\n            return NodeState.SUCCESS;\n        } else {\n            return NodeState.FAILURE;\n        }\n    }\n}\n","/// <reference path=\"../../../typings/easystarjs.d.ts\" />\n/// <reference path=\"../../../typings/brunch-require.d.ts\" />\nimport EasyStar = require('easystarjs');\n\nexport class Pathfinder {\n\n    private easystar: EasyStar.js;\n    private map: Phaser.Tilemap;\n\n    constructor(map: Phaser.Tilemap) {\n        this.map = map;\n        const pathfindLayer = map.getLayerIndex('pathfind');\n        const grid = new Array<Array<number>>();\n        for (let row = 0; row < map.height; ++row) {\n            var gridRow = new Array<number>(map.width);\n            for (let column = 0; column < map.width; ++column) {\n                const tile = map.getTile(column, row, pathfindLayer);\n                gridRow[column] = this.isTileWalkable(tile) ? 1 : 0;\n            }\n            grid[row] = gridRow;\n        }\n        this.easystar = new EasyStar.js();\n        this.easystar.setGrid(grid);\n        this.easystar.enableDiagonals();\n        this.easystar.setAcceptableTiles([1]);\n    }\n\n    randomWalkablePos(): Phaser.Point {\n        const pathfindLayer = this.map.getLayerIndex('pathfind');\n        const rnd = this.map.game.r