public SelectScreen2(int width, int height, IScreenMaster master) : base(width, height, master) { input = Settings.in2; Texture2D up = Load<Texture2D>("Image/buttonUp"); Texture2D down = Load<Texture2D>("Image/buttonDown"); SpriteFont font = Load<SpriteFont>("Font/text"); int centerX = widthScreen / 2 - up.Width / 2; ColorRect c = new ColorRect(0, 0, widthScreen, heightScreen, Color.Black); bg = c; Label t = new Label(widthScreen / 2, 10, font, "P2, Select Character"); t.x -= (int)t.GetDim().X / 2; title = t; Button back = new TextButton(centerX, heightScreen - up.Height - 10, up, down, font, "Back"); back.select += delegate() { ChangeScreen<SelectScreen1>(); }; CharacterButton wasp = new CharacterButton(100, 100, LoadAnim("waspIdle"), up, down); wasp.select += delegate() { Settings.P2_FIGHTER = "wasp"; ChangeScreen<GameScreen>(); }; buttons.Add(wasp); CharacterButton beetle = new CharacterButton(180, 100, LoadAnim("beetleIdle"), up, down); beetle.select += delegate() { Settings.P2_FIGHTER = "beetle"; ChangeScreen<GameScreen>(); }; buttons.Add(beetle); buttons.Add(back); }
public LoadGameScreen(int widthScreen, int heightScreen, IScreenMaster master) : base(widthScreen, heightScreen, master) { Texture2D up = Load<Texture2D>("Image/buttonUp"); Texture2D down = Load<Texture2D>("Image/buttonDown"); SpriteFont font = Load<SpriteFont>("Font/text"); int centerX = widthScreen / 2 - up.Width / 2; ColorRect c = new ColorRect(0, 0, widthScreen, heightScreen, Color.Black); bg = c; Label t = new Label(widthScreen / 2, 10, font, "Load Game"); t.x -= (int)t.GetDim().X / 2; title = t; Button back = new TextButton(centerX, heightScreen - up.Height - 10, up, down, font, "Back"); back.select += delegate() { ChangeScreen<MainMenuScreen>(); }; buttons.Add(back); }
public MainMenuScreen(int widthScreen, int heightScreen, IScreenMaster master) : base(widthScreen, heightScreen, master) { Audio.GetInstance().PlaySong(Load<SoundEffect>("Audio/Menu")); /* SoundEffectInstance soundEffectInstance = song.CreateInstance(); soundEffectInstance.IsLooped = true; soundEffectInstance.Play(); */ Settings.in1 = new FighterInput(PlayerIndex.One); Settings.in2 = new FighterInput(PlayerIndex.Two); input = Settings.in1; Texture2D up = Load<Texture2D>("Image/buttonUp"); Texture2D down = Load<Texture2D>("Image/buttonDown"); SpriteFont font = Load<SpriteFont>("Font/text"); int centerX = widthScreen / 2 - up.Width / 2; int buttonStartY = heightScreen / 3; int buttonSpacing = 10; bg = new Image(0, 0, Load<Texture2D>("Image/mainBg")); Label t = new Label(widthScreen / 2, 10, font, ""); t.x -= (int)t.GetDim().X / 2; title = t; Button newGame = new TextButton(300, 100, up, down, font, "Play?"); //Button loadGame = new TextButton(centerX, buttonStartY + up.Height + buttonSpacing, up, down, font, "Load Game"); //Button options = new TextButton(centerX, buttonStartY + 2 * (up.Height + buttonSpacing), up, down, font, "Options"); newGame.select += delegate() { ChangeScreen<SelectScreen1>(); }; //loadGame.select += delegate() { soundEffectInstance.Stop(); ChangeScreen<LoadGameScreen>(); }; //options.select += delegate() { soundEffectInstance.Stop(); ChangeScreen<OptionScreen>(); }; buttons.Add(newGame); //buttons.Add(loadGame); //buttons.Add(options); }