+ update() {
+
+ game.physics.arcade.collide(player, walls);
+ game.physics.arcade.overlap(player, determinations, function(p,d) { p.overlap_determination(d); });
+ game.physics.arcade.overlap(player, monsters, function(p,m) { m.overlap_player(p); });
+
+ if (game.time.now > nexttime_determination)
+ {
+ var determination = new Determination((Math.random() * (game.world.width - ((WALL_THICKNESS + WALL_BORDER) * 4))) + ((WALL_THICKNESS + WALL_BORDER) * 2), (Math.random() * (game.world.height - ((WALL_THICKNESS + WALL_BORDER) * 4) - WALL_BORDERBOTTOM)) + ((WALL_THICKNESS + WALL_BORDER) * 2));
+ determination.enablePhysics();
+ determinations.add(determination);
+ nexttime_determination = game.time.now + (WAIT_DETERMINATION / 2) + (Math.random() * WAIT_DETERMINATION);
+ }
+
+ if (game.time.now > nexttime_monsterspawn)
+ {
+ var monster = new Monster(Math.random() * game.world.width, Math.random() * game.world.height);
+ monster.enablePhysics();
+ monsters.add(monster);
+ 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;
+
+ if ((!player.alive) && (game.time.now > (player.lasttime_death + WAIT_DEATH)))
+ {
+ game.state.start('GameOver');
+ }