public void switchLevel(LevelEnum levelEnum, int id) { pauseTime = 30; level.removeEntityImmediately(player); level = Level.LoadLevel(this, levelEnum); level.findSpawn(id); player.x = level.xSpawn; player.z = level.ySpawn; ((LadderBlock) level.getBlock(level.xSpawn, level.ySpawn)).wait = true; player.x += Math.Sin(player.rot) * 0.2; player.z += Math.Cos(player.rot) * 0.2; level.addEntity(player); }
public void newGame() { Level.clear(); level = Level.LoadLevel(this, LevelEnum.Start); player = new Player(); player.level = level; level.player = player; player.x = level.xSpawn; player.z = level.ySpawn; level.addEntity(player); player.rot = Math.PI + 0.4; }