Done some balancing
authorMegaBrutal <code+git@megabrutal.com>
Wed, 27 Dec 2017 10:35:00 +0000 (11:35 +0100)
committerMegaBrutal <code+git@megabrutal.com>
Wed, 27 Dec 2017 10:35:00 +0000 (11:35 +0100)
– Player starts off with lower speed and gets faster in lower steps.
– Monsters spawn sooner depending on LV. With high enough LV, swarm of monsters may appear.

modified:   ld40.js

ld40.js

diff --git a/ld40.js b/ld40.js
index 5c84a99..2c8a2b0 100644 (file)
--- a/ld40.js
+++ b/ld40.js
@@ -21,7 +21,7 @@
         const MONSTER_HEALTH           =     20;
         const MODE_DETERMINATION       =      0;
         const MODE_JUSTICE             =      1;
-        const SPEED_PLAYER             =    150;
+        const SPEED_PLAYER             =     50;
         const SPEED_PROJECTILE         =    500;
 
         window.addEventListener("keydown", function(e) {
@@ -43,7 +43,7 @@
                 this.lasttime_shoot = 0;
                 this.lasttime_mode = 0;
                 this.lasttime_damage = 0;
-                this.speed = 150;
+                this.speed = SPEED_PLAYER;
                 this.switchmode(MODE_DETERMINATION);
                 this.projectiles = game.add.group();
                 this.healthBar = new HealthBar(60, game.world.height - (WALL_BORDERBOTTOM / 2));
                 var monster = new Monster(Math.random() * game.world.width, Math.random() * game.world.height);
                 monster.enablePhysics();
                 monsters.add(monster);
-                nexttime_monsterspawn = game.time.now + (WAIT_MONSTERSPAWN / player.love) + (Math.random() * WAIT_MONSTERSPAWN);
+                var waittime = WAIT_MONSTERSPAWN - ((Math.random() * 2000) * player.love);
+                nexttime_monsterspawn = game.time.now + waittime;
+                console.log('Next monster in ' + waittime);
             }
 
             if ((game.time.now - player.lastmovetime) > WAIT_KEY) player.body.velocity.x = player.body.velocity.y = 0;