/// <summary> /// builds the initial scene /// </summary> public override void SetupScene() { Score = 0.0f; game_over = false; _score_label = new EvilutionLabel("SCORE: " + Score, Colors.White, (uint)(this._width * 0.90f), 100); _score_label.Y = 20; _score_label.FontSize = 50; CenterObject(_score_label, true, false); this.AddObject(_score_label); Hero hero = new Hero("Hero"); hero.Location = new System.Numerics.Vector2(700, 700); hero.SetBitmapFromImageDictionary("Hero"); hero.LimitX = this._width; hero.LimitY = this._height; this.AddObject(hero); Boss boss = new Boss("Boss"); boss.Location = new System.Numerics.Vector2(1000, 150); boss.SetBitmapFromImageDictionary("Boss"); this.AddObject(boss); }
/// <summary> /// Set up the initial state of the scene /// </summary> public override void SetupScene() { // design the scene manually GenericItem title = new GenericItem("Title"); title.Location = new System.Numerics.Vector2(500, 100); title.SetBitmapFromImageDictionary("GameOver"); this.AddObject(title); CenterObject(title, true, false); _start_button = new EvilutionButton("Main Menu", Colors.White, 350, 50); CenterObject(_start_button); this.AddObject(_start_button); if (StoryBoard.SceneHistory.Count > 0) { Score = StoryBoard.SceneHistory.Peek().Score; } _score_label = new EvilutionLabel("SCORE: " + Score, Colors.White, (uint)(this._width * 0.90f), 100); _score_label.Y = _start_button.Y - 200; _score_label.FontSize = 50; CenterObject(_score_label, true, false); this.AddObject(_score_label); // event callbacks _start_button.ButtonClick += _start_button_ButtonClick; void _start_button_ButtonClick(object sender, EvilutionButton_Event e) { // create the scene switch message to switch the current scene to the main game scene Message_SceneSwitch mss = new Message_SceneSwitch("Generic Title Scene"); MessageManager.AddMessageItem(mss); } }