Example #1
0
        public FullLevelMenu(LevelManager Parent, Level Target, InputController Input, ContentManager CM, Dictionary<String, Player> Players, int x, int y, int xprime, int yprime)
        {
            parent = Parent;
            font = parent.font;
            current_index = 0;
            x_position = x;
            y_position = y;
            y_spacing = yprime;
            x_spacing = xprime;
            image = CM.Load<Texture2D>("Main Menu");
            cursor_image = CM.Load<Texture2D>("laser");
            addMenuItem(new Level_Button(parent, Target));
            wallType = new ToggleWallsButton(Target);
            wallType.addOption("Full Reflective", Level.WallType.FullReflect);
            wallType.addOption("Full Absorb", Level.WallType.FullAbsorb);
            wallType.addOption("H", Level.WallType.SideReflect);
            wallType.addOption("I", Level.WallType.UpDownReflect);
            wallType.addOption("X", Level.WallType.DiagonalReflectingOctagon);
            wallType.execute();
            addMenuItem(wallType);
            reflectiveAllowance = new ToggleLimitsButton(Target, Surface.SurfaceType.Reflective);
            addMenuItem(reflectiveAllowance);

            absorbantAllowance = new ToggleLimitsButton(Target, Surface.SurfaceType.Absorbant);
            addMenuItem(absorbantAllowance);

            refractiveAllowance = new ToggleLimitsButton(Target, Surface.SurfaceType.Refractive);
            addMenuItem(refractiveAllowance);

            player1Start = new FlashText(font, "Player 1 Press Start", 500f, 100, 660, Color.Red);

            player2Start = new FlashText(font, "Player 2 Press Start", 500f, 750, 660, Color.Blue);

            players = Players;
        }
Example #2
0
 public Laser_Turret(InputController.InputMode playerMode)
 {
     input = new InputController(playerMode);
     position = new Vector2(0, 0);
     orientation = 0f;
     id = "Player1";
     color = Color.Red;
     cursor = new Cursor(this, input, m_parent);
     m_rotation = 0;
 }
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"));
 }
Example #4
0
 public FullMenu(LevelManager Parent, InputController Input,ContentManager CM,  String assetName)
 {
     parent = Parent;
     //input = Input;
     font = parent.font;
     current_index = 0;
     x_position = 600;
     y_position = 200;
     y_spacing = 20;
     x_spacing = 0;
     image = CM.Load<Texture2D>(assetName);
     cursor_image = CM.Load<Texture2D>("laser");
 }
Example #5
0
        public Laser_Turret(Level parent, InputController.InputMode playerMode, LevelManager Manager, int a, int b, int c)
        {
            energy = 748;
            health = 748;
            m_parent = parent;
            input = new InputController(playerMode);
            id = input.getMode();
            manager = Manager;

               reflect_limit=b;
               absorb_limit=a;
               refract_limit=c;
               absorb_amount=0;
               reflect_amount=0;
               refract_amount=0;
               m_rotation = 0;

            switch (id)
            {
                case "Player1":
                    health_bar_pos = 0;
                    energy_bar_pos = 8;
                    position = new Vector2(30, m_parent.height / 2);
                    laserStart = new Vector2(51, m_parent.height / 2);
                    orientation = 0f;
                    id = "Player 1";
                    color = Color.Red;
                    cursor = new Cursor(this, input, m_parent);
                    break;

                case "Player2":

                    health_bar_pos = m_parent.width - 5;
                    energy_bar_pos = m_parent.width - 13;
                    position = new Vector2(m_parent.width - 33, m_parent.height / 2);
                    laserStart = new Vector2(m_parent.width - 54, m_parent.height / 2);
                    orientation = (float)Math.PI;
                    id = "Player 2";
                    color = Color.Blue;

                    cursor = new Cursor(this, input, m_parent);
                    break;

                default:
                    throw new NotImplementedException("Received unexpected input mode");
            }
            bounds = new BoundingBox(new Vector3(position.X - 20, position.Y - 20, -1), new Vector3(position.X + 20, position.Y + 20, 1));
        }
Example #6
0
 public Player(InputController.InputMode PlayerNumber)
 {
     input = new InputController(PlayerNumber);
     switch (PlayerNumber)
     {
         case InputController.InputMode.Player1:
             colorIndex = 0;
             setColor();
             id = "Player1";
             break;
         case InputController.InputMode.Player2:
             colorIndex = 5;
             setColor();
             id = "Player2";
             break;
     }
     current_menu_index = 0;
 }
Example #7
0
        //private bool tower_selected;
        public Cursor(Laser_Turret Parent, InputController Input, Level Region)
        {
            input = Input;
            parent = Parent;
            player = Parent.id;
            region = Region;
            position = parent.getPosition();
            switch (player){

                case "Player 1":

            position.X += 10f;

                    break;

                case "Player 2":
                    position.X -= 10f;
                break;

                default:
                throw new NotImplementedException("Received unexpected output");
            }
            color = parent.color;
        }
Example #8
0
 public void addPlayer(InputController.InputMode playerNUM)
 {
     players.Add("" + playerNUM, new Player(playerNUM));
 }
Example #9
0
 public void removePlayer(InputController.InputMode player)
 {
     players.Remove("" + player);
 }
Example #10
0
 public void AddTurret(InputController.InputMode playerMode)
 {
     Laser_Turret add = new Laser_Turret(this, playerMode, manager, absorb_limit, reflect_limit, refract_limit);
     turrets.Add(add);
     add.loadImage(m_content);
 }