public MenuScene()
            : base()
        {
            List<Button> buttons = new List<Button>();

            buttons.Add(new Button("play", Play));
            buttons.Add(new Button("how to play", HowTo));
            buttons.Add(new Button("quit", Exit));

            menu = new Menu("Main Menu", buttons);
        }
        public GameOverScene(int score)
            : base()
        {
            List<Button> buttons = new List<Button>();

            buttons.Add(new Button("play again", Play));
            buttons.Add(new Button("quit", Exit));

            menu = new Menu("Game Over", buttons);

            this.score = score;
        }
Example #3
0
 public LevelManager(ContentManager theCM)
 {
     input = new InputController();
     CM = theCM;
     font = theCM.Load<SpriteFont>("Text");
     LevelMenu = new FullMenu(this, players, CM, "Main menu", 400, 400, 0, 20);
     PuzzleMenu = new FullMenu(this, players, CM, "Main menu", 400, 400, 0 , 20);
     LevelMenu.addMenuItem(new AddMenuItem(this, new FullLevelMenu(this, new BattleLevel(CM, this, "Basic Battle Level"), input, CM, players, 400, 400, 0, 20), "Battle Level"));
     LevelMenu.addMenuItem(new AddMenuItem(this, PuzzleMenu, "Puzzle Levels"));
     LevelMenu.addMenuItem(new AddMenuItem(this, new FullLevelMenu(this, new HordeLevel(CM, this, "Horde Level"), input, CM, players, 400, 400, 0, 20), "Horde Level"));
     LevelMenu.addMenuItem(new AddMenuItem(this, new FullLevelMenu(this, new PrismBattleLevel(CM, this, "Prism-Battle Level") , input, CM, players, 400, 400, 0, 20), "Prism-Battle Level"));
 }
        public InfoScene(Scene prevScene)
            : base()
        {
            List<Button> buttons = new List<Button>();

            buttons.Add(new Button("main menu", ToMenu));
            buttons.Add(new Button("quit", Exit));

            menu = new Menu("Info", buttons);

            this.prevScene = prevScene;
        }
        public PauseScene(Scene prevScene)
            : base()
        {
            List<Button> buttons = new List<Button>();

            buttons.Add(new Button("resume", Play));
            buttons.Add(new Button("main menu", ToMenu));
            buttons.Add(new Button("quit", Exit));

            menu = new Menu("Paused", buttons);

            this.prevScene = prevScene;
        }
Example #6
0
        public void LoadContent()
        {
            if (_currentLevel == 0) // menu
            {
                buttonsTextures[0] = _content.Load<Texture2D>("textures/Buttons/start");
                buttonsTextures[1] = _content.Load<Texture2D>("textures/Buttons/exit");
                buttonsTextures[2] = _content.Load<Texture2D>("textures/Buttons/pause");
                buttonsTextures[3] = _content.Load<Texture2D>("textures/Buttons/resume");
                buttonsTextures[4] = _content.Load<Texture2D>("textures/Buttons/Menu");
                buttonsTextures[5] = _content.Load<Texture2D>("textures/Buttons/multiplayerButton");

                menu = new Menu(buttonsTextures, 1280, 720);
            }
            else if (_currentLevel == 1)  //level 1
            {

                //background
                Sprite levelBackground = new Sprite(_backgroundTexture, new Rectangle(0, 0, _backgroundTexture.Width, _backgroundTexture.Height)) {Id = 8000 , IsActive = true}; // this way it collides but loads the bg
                _gameObjects.Add(levelBackground);

                //player tank
                Texture2D tank = _content.Load<Texture2D>("sprites/BlueTank/BlueTank");
                FourFrameSprite playerSprite = new FourFrameSprite(tank, 40, 40, Color.White);
                _gameObjects.Add(new Player(playerSprite, new Vector2(620,700 ), 3) { Id = 1 });

                //level (will extract in a method or class)
                //Texture2D tuhla_v2 = _content.Load<Texture2D>("textures/Bricks/480px-Brick_Block_-_New_Super_Mario_Bros");
                _level1 = new Level_1();
                GenerateLevel(_level1.GetLevel());

                //Load Bullets
                LoadBullets();

            }
            else if (_currentLevel == 2) // Player vs Player (local)
            {
                //background
                Sprite levelBackground = new Sprite(_backgroundTexture, new Rectangle(0, 0, _backgroundTexture.Width, _backgroundTexture.Height)) { Id = 8000, IsActive = true }; // this way it collides but loads the bg
                _gameObjects.Add(levelBackground);

                //player tank
                Texture2D tank = _content.Load<Texture2D>("sprites/BlueTank/BlueTank");
                FourFrameSprite playerSprite = new FourFrameSprite(tank, 40, 40, Color.White);
                _gameObjects.Add(new Player(playerSprite, new Vector2(620, 700), 2) { Id = 1 });

                //player2 tank
                Texture2D tank2 = _content.Load<Texture2D>("sprites/GreenTank/GreenTank");
                FourFrameSprite player2Sprite = new FourFrameSprite(tank2, 40, 40, Color.White);
                _gameObjects.Add(new Player_2(player2Sprite, new Vector2(620, 0), 3) { Id = 2 });
                //level (will extract in a method or class)
                //Texture2D tuhla_v2 = _content.Load<Texture2D>("textures/Bricks/480px-Brick_Block_-_New_Super_Mario_Bros");
                _level1 = new Level_1();
                GenerateLevel(_level1.GetLevel());

                //Load Bullets
                LoadBullets();
            }
        }
Example #7
0
 public void clearMenus()
 {
     activeMenus.Clear();
     currentMenu = null;
 }
Example #8
0
 public void cancelMenu()
 {
     activeMenus.Pop();
     if (activeMenus.Count != 0) currentMenu = activeMenus.Peek();
     else currentMenu = null;
 }
Example #9
0
 public void addMenu(Menu menu)
 {
     activeMenus.Push(menu);
     currentMenu = menu;
 }
Example #10
0
 public AddMenuItem(LevelManager Manager, Menu Target, String ID)
 {
     manager = Manager;
     target = Target;
     id = ID;
 }
Example #11
0
 public AddMenuItem(LevelManager Manager, Menu Target)
 {
     manager = Manager;
     target = Target;
     id = "Default menu ID";
 }