private void BeginNextLvl(object sender, RoutedEventArgs e) { Level3 lvl3 = new Level3(); lvl3.Show(); Lvl2.Close(); }
public void EventChecker(Events events, TileMap currentMap, Lvl1 lvl1, Lvl2 lvl2, SpriteBatch spriteBatch) { if (rectangle.EventCheck(events.Rectangle, pee == true) && events.EventID == 0) { spawnPosition.X = rectangle.X; spawnPosition.Y = rectangle.Y; } if (rectangle.EventCheck(events.Rectangle, bark == true) && events.EventID == 1) { if (lvl1.Finished == false) { spawnPosition.X = 0; spawnPosition.Y = 525; position.X = 0; position.Y = 525; currentMap.LevelID++; currentMap.Finished = true; } if (lvl2.Finished == false && lvl1.Finished == true) { currentMap.Finished = true; } } if (rectangle.EventCheck(events.Rectangle, bark == true) && events.EventID == 2 && events.IsChecked == false) { lives++; events.IsChecked = true; events.Texture = content.Load <Texture2D>("lifetaken"); } }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here camera = new Camera(GraphicsDevice.Viewport); lvl1 = new Lvl1(Content); lvl2 = new Lvl2(Content); current = lvl1; base.Initialize(); }
private void Level2() { if (level == 1) { if (caps.Count == 0) { level++; Lvl2.ToCaps(caps); createMonsters(); } } }