Example #1
0
 public SwitchModel(Game game,
             Pointf position)
     : base(game, position, new Size(10, 10), new Velocity())
 {
     mBlocksOnCollision = false;
     mState = Status.OFF;
 }
Example #2
0
        public Hud(Pointf position, Game game, int level)
            : base(game)
        {
            HUD_WIDTH = Game.Window.ClientBounds.Width;
            mTextBox = game.Content.Load<Texture2D>("textbox");
            mPosition = position;
            mCurrentTime = 0;
            playerDeathIndex = -1;

            // Set up variables to display text for level one
            mCurrentText = new List<String>();
            mLevelText = new List<List<String>>();

            // Text to display for level 1
            switch (level)
            {
                case 1:
                    mLevelText.Add(SpeechText.getTextArray(SpeechTextState.Level1PlusSpeech1, TEXT_LINE_LIMIT));
                    mLevelText.Add(SpeechText.getTextArray(SpeechTextState.Level1MinusSpeech1, TEXT_LINE_LIMIT));
                    mLevelText.Add(SpeechText.getTextArray(SpeechTextState.Level1Info, TEXT_LINE_LIMIT));
                    break;
                case 2:
                    mLevelText.Add(SpeechText.getTextArray(SpeechTextState.OneVsOneNarration, TEXT_LINE_LIMIT));
                    break;
                case 3:
                    mLevelText.Add(SpeechText.getTextArray(SpeechTextState.Boss1PlusSpeech1, TEXT_LINE_LIMIT));
                    mLevelText.Add(SpeechText.getTextArray(SpeechTextState.Boss1BossSpeech1, TEXT_LINE_LIMIT));
                    mLevelText.Add(SpeechText.getTextArray(SpeechTextState.Boss1MinusSpeech1, TEXT_LINE_LIMIT));
                    mLevelText.Add(SpeechText.getTextArray(SpeechTextState.Boss1PlusSpeech2, TEXT_LINE_LIMIT));
                    mLevelText.Add(SpeechText.getTextArray(SpeechTextState.Boss1BossSpeech2, TEXT_LINE_LIMIT));
                    break;
            }
        }
Example #3
0
        public Character(Game game,
                            Pointf position,
                            Size size,
                            Velocity velocity,
                            PlayerIndex index
                        )
            : base(game, position, size, velocity)
        {
            EnableFreeFall();

            currentPlayer = index;
            if (currentPlayer == PlayerIndex.One)
            {
                mPlayerIndex = 0;
            }
            else if (currentPlayer == PlayerIndex.Two)
            {
                mPlayerIndex = 1;
            }
            else
            {
                mPlayerIndex = 2;
            }

            mSongJump = game.Content.Load<SoundEffect>("jump4");
        }
Example #4
0
 public Model(Game game,
              Pointf position,
              Size size,
              Velocity velocity)
     : this(game, position, size, velocity, 0)
 {
 }
Example #5
0
 public Displayable(Pointf position,
                    Size size,
                    Velocity velocity)
 {
     Position = new Pointf(position);
     Size = new Size(size);
     mVelocity = new Velocity(velocity);
 }
Example #6
0
 public Wall(Game game, Pointf position, Size size, Colors color)
     : base(game, position, size, new Velocity(), (int)color)
 {
     mBlocksOnCollision = true;
     isHorizontal = true;
     if (size.Height > size.Width)
     {
         isHorizontal = false;
     }
 }
Example #7
0
 public ExampleModel(Game game,
                     Pointf position,
                     Size size,
                     Velocity velocity)
     : base(game, position, size, velocity, 0)
 {
     //  how you would move
     mPosition.X = 40;
     Velocity.Speed = new Vector2(1,1);
     Velocity.Direction = new Vector2(2, 0);
 }
Example #8
0
        public Model(Game game,
                     Pointf position,
                     Size size,
                     Velocity velocity,
                     int parameterized)
            : base(game,
                 new Displayable(position, size, velocity), parameterized)
        {
            mDestroy = false;
            mId = idCntr++;
            mIsFreeFall = false;
            mFrames = new List<Frame>();
            GenerateFrames();

            mPosition.X += size.Width / 2;
            mPosition.Y += size.Height / 2;
        }
Example #9
0
 public static Wall BuildWall(Pointf wallPosition, Size wallSize, Wall.Colors wallColor, ref MapModel map)
 {
     Wall wall = new Wall(map.Game, new Pointf(wallPosition.X, wallPosition.Y), new Size(wallSize.Width, wallSize.Height), wallColor);
     map.AddComponent(wall);
     return wall;
 }
Example #10
0
 public static SwitchModel BuildSwitch(Pointf switchPosition)
 {
     var temp = GetMap();
     return BuildSwitch(switchPosition, ref temp);
 }
Example #11
0
 public static SwitchModel BuildSwitch(Pointf switchPosition, ref MapModel map)
 {
     SwitchModel toAdd = new SwitchModel(map.Game, switchPosition);
     map.AddComponent(toAdd);
     return toAdd;
 }
Example #12
0
 public static Collectable BuildCollectable(Pointf position, ref MapModel map, int points)
 {
     Collectable c = new Collectable(map.Game, position, points);
     map.AddComponent(c);
     return c;
 }
Example #13
0
 public static Resistor BuildResistor(Pointf position, Resistor.Type index)
 {
     var temp = GetMap();
     return BuildResistor(position, index, ref temp);
 }
Example #14
0
 public static Resistor BuildResistor(Pointf position, Resistor.Type index, ref MapModel map)
 {
     Resistor res = new Resistor(map.Game, position, index);
     map.AddComponent(res);
     return res;
 }
Example #15
0
 public MoveableBox(Game game, Pointf position, Size size)
     : base(game, position, size, new Velocity())
 {
     mBlockedWallId = -1;
     EnableFreeFall();
 }
Example #16
0
 public WaterModel(Game game, Pointf position)
     : base(game, position, new Size(10, 2), new Velocity())
 {
 }
Example #17
0
 public static ElevatorModel BuildElevator(Pointf elevatorPosition, ref MapModel map)
 {
     return BuildElevator(elevatorPosition, GetDefaultElevatorColumnSpan() * DEFAULT_PLATFORM_WIDTH, GetDefaultElevatorLevelSplan() * DEFAULT_PLATFORM_HEIGHT, ref map);
 }
Example #18
0
 public static ElevatorModel BuildElevator(Pointf elevatorPosition, float elevatorWidth, float maxMovementHeight, ref MapModel map)
 {
     ElevatorModel elev = new ElevatorModel(map.Game, elevatorWidth, maxMovementHeight, elevatorPosition);
     map.AddComponent(elev);
     return elev;
 }
Example #19
0
 public static Wall BuildWall(Pointf wallPosition, Size wallSize, Wall.Colors wallColor)
 {
     var temp = GetMap();
     return BuildWall(wallPosition, wallSize, wallColor, ref temp);
 }
Example #20
0
 public Resistor(Game game, Pointf position, Type type)
     : base(game, position, new Size(45, 20), new Velocity(), (int)type)
 {
     DisableFreeFall();
     mBlocksOnCollision = false;
 }
Example #21
0
 public Frame(Pointf position, Size size)
 {
     mArea = new Rectangle((int)position.X, (int)position.Y,
                           (int)size.Width, (int)size.Height);
 }
Example #22
0
 public ExitDoorModel(Game game,Pointf position, PlayerIndex pIndex)
     : base(game,new Pointf(position.X, position.Y - 64), new Size(96,64),new Velocity(),(int)pIndex)
 {
     mBlocksOnCollision = false;
 }
Example #23
0
 public static Collectable BuildCollectable(Pointf position, int points)
 {
     var temp = GetMap();
     return BuildCollectable(position, ref temp, points);
 }
Example #24
0
 public static ExitDoorModel BuildExitDoor(Pointf doorPosition, PlayerIndex playerIndex, ref MapModel map)
 {
     ExitDoorModel exit = new ExitDoorModel(map.Game, doorPosition, playerIndex);
     map.AddComponent(exit);
     return exit;
 }
Example #25
0
 public static ElevatorModel BuildElevator(Pointf elevatorPosition, float elevatorWidth, float maxMovementHeight)
 {
     var temp = GetMap();
     return BuildElevator(elevatorPosition, elevatorWidth, maxMovementHeight, ref temp);
 }
Example #26
0
 public static ExitDoorModel BuildExitDoor(Pointf doorPosition, PlayerIndex playerIndex)
 {
     var temp = GetMap();
     return BuildExitDoor(doorPosition, playerIndex, ref temp);
 }
Example #27
0
 public static ElevatorModel BuildElevator(Pointf elevatorPosition)
 {
     var temp = GetMap();
     return BuildElevator(elevatorPosition, ref temp);
 }
Example #28
0
 public static MoveableBox BuildMoveableBox(Pointf boxPosition, Size boxSize, ref MapModel map)
 {
     MoveableBox box = new MoveableBox(map.Game, boxPosition, boxSize);
     map.AddComponent(box);
     return box;
 }
Example #29
0
 public Collectable(Game game, Pointf position, int points)
     : base(game, position, new Size(30,30), new Velocity())
 {
     mPoints = points;
     DisableFreeFall();
 }
Example #30
0
 public static MoveableBox BuildMoveableBox(Pointf boxPosition, Size boxSize)
 {
     var temp = GetMap();
     return BuildMoveableBox(boxPosition, boxSize, ref temp);
 }