From: MegaBrutal Date: Thu, 28 Dec 2017 01:00:00 +0000 (+0100) Subject: Merge branches 'cleaning' and 'balancing' X-Git-Url: http://git.megabrutal.com/?p=ld40.git;a=commitdiff_plain;h=196048400fbe50d1f238f4385a0b3a85f45863a5;hp=5f3463c147818b19f14e43ac6844fa1acfce931e Merge branches 'cleaning' and 'balancing' modified: ld40.js --- diff --git a/ld40.js b/ld40.js index 7b14c05..f7954c2 100644 --- a/ld40.js +++ b/ld40.js @@ -44,7 +44,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.weapon = new JusticeBlaster(game, this); this.weapon.bulletSpeed = SPEED_PPROJECTILE; @@ -263,9 +263,7 @@ nexttime_determination = Math.random() * WAIT_DETERMINATION; monsters = game.add.group(); - monsters.add(new Monster(400, 500)); - monsters.children.forEach(function(monster) { monster.enablePhysics(); }); - nexttime_monsterspawn = WAIT_MONSTERSPAWN; + nexttime_monsterspawn = WAIT_MONSTERSPAWN / 4; player = new Player(game.world.width / 2, game.world.height / 2); player.enablePhysics(); @@ -294,7 +292,9 @@ 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;