X-Git-Url: http://git.megabrutal.com/?p=ld40.git;a=blobdiff_plain;f=ld40.js;h=2c8a2b0a3a558e75d53303414420077581d42b26;hp=5c84a995a30a5ca2e5a4df6f865ac57b969e6bd9;hb=98934c1cc490e5de98fd1f210bbed6618c5c3063;hpb=5552258b72f6a572f6baae3c33214b095780c64c diff --git a/ld40.js b/ld40.js index 5c84a99..2c8a2b0 100644 --- 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)); @@ -291,7 +291,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;