public void Select() { levelSelected = true; if (level == ConstantNumber.LEVEL_1) { LevelLoader.LoadLevel(gameObjects, @"level.csv"); keyboardController.ClearCommand(); LoadGamePlayingCommand(); } else if (level == ConstantNumber.LEVEL_2) { LevelLoader.LoadLevel(gameObjects, @"hardlevel.csv"); keyboardController.ClearCommand(); LoadGamePlayingCommand(); } else if (level == ConstantNumber.LEVEL_3) { LevelLoader.LoadLevel(gameObjects, @"pkLevel.csv"); keyboardController.ClearCommand(); isPkMode = true; LoadGamePlayingCommand(); luigi.Evolve(); } else if (level == ConstantNumber.LEVEL_4) { Exit(); } backgroundList.Add(BackgroundSpriteFactory.Instance.CreateCloud(new Vector2(600, 100))); backgroundList.Add(BackgroundSpriteFactory.Instance.CreateCloud(new Vector2(100, 100))); backgroundList.Add(BackgroundSpriteFactory.Instance.CreateCloud(new Vector2(300, 300))); backgroundList.Add(BackgroundSpriteFactory.Instance.CreateCloud(new Vector2(2600, 100))); backgroundList.Add(BackgroundSpriteFactory.Instance.CreateCloud(new Vector2(2100, 50))); backgroundList.Add(BackgroundSpriteFactory.Instance.CreateCloud(new Vector2(1300, 80))); backgroundList.Add(BackgroundSpriteFactory.Instance.CreateBush(new Vector2(1200, 435))); backgroundList.Add(BackgroundSpriteFactory.Instance.CreateBush(new Vector2(100, 435))); backgroundList.Add(BackgroundSpriteFactory.Instance.CreateBush(new Vector2(200, 435))); backgroundList.Add(BackgroundSpriteFactory.Instance.CreateCastle(new Vector2(3200, 366))); if (isPkMode) { marioHealthBar = BackgroundSpriteFactory.Instance.CreateHealthBar(new Vector2(ConstantNumber.MARIO_HEALTH_BAR_X, ConstantNumber.MARIO_HEALTH_BAR_Y)); luigiHealthBar = BackgroundSpriteFactory.Instance.CreateHealthBar(new Vector2(ConstantNumber.LUIGI_HEALTH_BAR_X, ConstantNumber.LUIGI_HEALTH_BAR_Y)); mario.Evolve(); } HUD = new HeadsUpDisplay(this, Content); collisionInvoker = new CollisionInvoker(mario); }
protected override void Initialize() { LoadContent(); DoorBombed.ResetBombedDoors(); DoorClosed.ResetClosedDoors(); DoorLocked.ResetLockedfDoors(); LootManagement.ResetLoot(); player = new Link(this); player.Position = new Vector2(0, 160); LinkSpriteFactory.Instance.player = player; if (playerDebug) { player.Health = 1000; player.TotalHealth = 1000; player.ItemCounts[ItemType.Map]++; player.ItemCounts[ItemType.Compass]++; player.ItemCounts[ItemType.Rupee] = 89; } player.ItemCounts[ItemType.Rupee] += 10; hud = new HeadsUpDisplay(this, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight); screen = new NormalScreen(this, GraphicsDevice, graphics); gameState = new NormalGameState(this); this.IsMouseVisible = true; base.Initialize(); currentRoom = new Room1(this, new Vector2(graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight / 2 + 84), floortilebase); currentRoom.LoadRoom("RoomC6"); if (playerDebug) { currentRoom.LoadRoom("RoomDEBUG"); } roomIndex = Array.FindIndex(rooms, x => x == "RoomC6"); lightingManager = new LightingManager(this); savedPlayer = new Link(this); savedRoom = new Room1(this, new Vector2(graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight / 2 + 84), floortilebase); savedScreen = new NormalScreen(this, GraphicsDevice, graphics); notificationsQueue = new Queue <INotification>(); SoundFactory.Instance.musicDungeonLoop.Play(); }
protected override void Initialize() { LoadContent(); player = new Link(this); player.Position = new Vector2(200, 360); LinkSpriteFactory.Instance.player = player; hud = new HeadsUpDisplay(this, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight); screen = new NormalScreen(this, GraphicsDevice, graphics); gameState = new NormalGameState(this); this.IsMouseVisible = true; base.Initialize(); currentRoom = new Room1(this, new Vector2(graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight / 2 + 84), floortilebase); currentRoom.LoadRoom("RoomDEBUG"); SoundFactory.Instance.musicDungeonLoop.Play(); }