예제 #1
0
         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);
        }
예제 #2
0
        public MainMenuScreen(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;
            int buttonStartY  = heightScreen / 3;
            int buttonSpacing = 10;

            ColorRect c = new ColorRect(0, 0, widthScreen, heightScreen, Color.Black);

            bg = c;

            Label t = new Label(widthScreen / 2, 10, font, "Project: Height");

            t.x  -= (int)t.GetDim().X / 2;
            title = t;

            Button newGame  = new TextButton(centerX, buttonStartY, up, down, font, "New Game");
            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() { LevelLoader.Load(1); ChangeScreen <StoryScreen>(); };
            loadGame.select += delegate() { ChangeScreen <LoadGameScreen>(); };
            options.select  += delegate() { ChangeScreen <OptionScreen>(); };

            buttons.Add(newGame);
            buttons.Add(loadGame);
            buttons.Add(options);
        }
예제 #3
0
        public InGameScreen(int widthScreen, int heightScreen, IScreenMaster master)
            : base(widthScreen, heightScreen, master)
        {
            LevelLoader load = LevelLoader.GetCurrentLoader();

            lvl = load.CreateLevel(this);
        }
예제 #4
0
        public InGameScreen(int widthScreen, int heightScreen, IScreenMaster master)
            : base(widthScreen, heightScreen, master)
        {
            LevelLoader load = LevelLoader.GetCurrentLoader();

            lvl = load.CreateLevel(this);
        }
예제 #5
0
        public MainMenuScreen(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;
            int buttonStartY = heightScreen / 3;
            int buttonSpacing = 10;

            ColorRect c = new ColorRect(0, 0, widthScreen, heightScreen, Color.Black);
            bg = c;

            Label t = new Label(widthScreen / 2, 10, font, "Project: Height");
            t.x -= (int)t.GetDim().X / 2;
            title = t;

            Button newGame = new TextButton(centerX, buttonStartY, up, down, font, "New Game");
            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() { LevelLoader.Load(1); ChangeScreen<StoryScreen>(); };
            loadGame.select += delegate() { ChangeScreen<LoadGameScreen>(); };
            options.select += delegate() { ChangeScreen<OptionScreen>(); };

            buttons.Add(newGame);
            buttons.Add(loadGame);
            buttons.Add(options);
        }
예제 #6
0
 public MenuScreen(int widthScreen, int heightScreen, IScreenMaster master)
     : base(widthScreen, heightScreen, master)
 {
     buttons       = new List <Button>();
     current       = -1;
     buttonPressed = false;
     timeout       = 0;
     hovering      = false;
     hovering      = true;
 }
예제 #7
0
 public MenuScreen(int widthScreen, int heightScreen, IScreenMaster master)
     : base(widthScreen, heightScreen, master)
 {
     buttons = new List<Button>();
     current = -1;
     buttonPressed = false;
     timeout = 0;
     hovering = false;
     hovering = true;
 }
예제 #8
0
        public PreGameScreen(int widthScreen, int heightScreen, IScreenMaster master)
            : base(widthScreen, heightScreen, master)
        {
            LevelLoader lvl = LevelLoader.GetCurrentLoader();

            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 centerY = heightScreen / 2 - up.Height / 2;

            cont = new TextButton(centerX, centerY, up, down, font, "Continue to InGame (Level " + lvl.GetId() + ")");

            cont.select += delegate() { ChangeScreen <InGameScreen>(); };
        }
예제 #9
0
        public PreGameScreen(int widthScreen, int heightScreen, IScreenMaster master)
            : base(widthScreen, heightScreen, master)
        {
            LevelLoader lvl = LevelLoader.GetCurrentLoader();

            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 centerY = heightScreen / 2 - up.Height / 2;

            cont = new TextButton(centerX, centerY, up, down, font, "Continue to InGame (Level " + lvl.GetId() + ")");

            cont.select += delegate() { ChangeScreen<InGameScreen>(); };
        }
예제 #10
0
        public GameScreen(int widthScreen, int heightScreen, IScreenMaster master) : base(widthScreen, heightScreen, master)
        {
            Audio.GetInstance().PlaySong(Load <SoundEffect>("Audio/battle"));

            p  = new Physics();
            bg = new Background(Load <Texture2D>("Image/stage"));

            var pos1 = new Vector2(50, 150);
            var pos2 = new Vector2(440, 150);

            p1 = GetFighter(pos1, Load <Texture2D>("Image/p1"), Settings.in1, false, Settings.P1_FIGHTER);
            p2 = GetFighter(pos2, Load <Texture2D>("Image/p2"), Settings.in2, true, Settings.P2_FIGHTER);

            h1 = new HealthBar(p1, Load <Texture2D>("Image/blue"), false, new Vector2(10, 10));
            h2 = new HealthBar(p2, Load <Texture2D>("Image/red"), true, new Vector2(widthScreen - 110, 10));

            w1 = new Wall(new Rectangle(-30, -1000, 30, 1000 + heightScreen));
            w2 = new Wall(new Rectangle(widthScreen, -1000, 30, 1000 + heightScreen));
        }
예제 #11
0
        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);
        }
예제 #12
0
        public GameScreen(int widthScreen, int heightScreen, IScreenMaster master) : base(widthScreen, heightScreen, master)
        {
            Audio.GetInstance().PlaySong(Load<SoundEffect>("Audio/battle"));

            p = new Physics();
            bg = new Background(Load<Texture2D>("Image/stage"));

            var pos1 = new Vector2(50, 150);
            var pos2 = new Vector2(440, 150);
            
            p1 = GetFighter(pos1, Load<Texture2D>("Image/p1"), Settings.in1, false, Settings.P1_FIGHTER);
            p2 = GetFighter(pos2, Load<Texture2D>("Image/p2"), Settings.in2, true, Settings.P2_FIGHTER);

            h1 = new HealthBar(p1, Load<Texture2D>("Image/blue"), false, new Vector2(10, 10));
            h2 = new HealthBar(p2, Load<Texture2D>("Image/red"), true, new Vector2(widthScreen - 110, 10));

            w1 = new Wall(new Rectangle(-30,-1000,30,1000+heightScreen));
            w2 = new Wall(new Rectangle(widthScreen, -1000, 30, 1000+heightScreen));

        }
예제 #13
0
        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);
        }
예제 #14
0
        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);
        }
예제 #15
0
        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);
        }
예제 #16
0
        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);
        }
예제 #17
0
 public MenuScreen(int widthScreen, int heightScreen, IScreenMaster master)
     : base(widthScreen, heightScreen, master)
 {
     buttons = new List <Button>();
 }
예제 #18
0
 public MenuScreen(int widthScreen, int heightScreen, IScreenMaster master)
     : base(widthScreen, heightScreen, master)
 {
     buttons = new List<Button>();
 }
예제 #19
0
 public Screen(int widthScreen_, int heightScreen_, IScreenMaster c_)
 {
     widthScreen  = widthScreen_;
     heightScreen = heightScreen_;
     c            = c_;
 }