예제 #1
0
 public VictoryGameState(SuperPixelBrosGame game, ArrayList controllerList, ICamera camera, IMario mario, FlagPole flagPole) : base(game, controllerList, camera)
 {
     levelTimeOut  = LEVEL_TIMEOUT_START;
     this.flagPole = flagPole;
     this.mario    = mario;
     location      = mario.Location;
     MediaPlayer.Stop();
     SoundFactory.Instance.PlaySoundEffect("SOUND_FLAGPOLE");
 }
예제 #2
0
 public override void Update()
 {
     if (levelTimeOut > 0)
     {
         IPhysics    marioPhysics   = (IPhysics)mario;
         ICollidable marioCollision = (ICollidable)mario;
         PlayerLevel.Instance.LevelUpdate(camera);
         PlayerLevel.Instance.BackgroundDestination = new Rectangle((int)location.X - 391, 0, 800, 480);
         if (mario.Location.Y <= (flagPole.Location.Y + flagPole.Hitbox.Height - marioCollision.Hitbox.Height) && !(mario.MovementState is MarioRightJumpState))
         {
             marioPhysics.Velocity = new Vector2(0, 2);
         }
         if (flagPole.Flag.Location.Y < (flagPole.Location.Y + flagPole.Hitbox.Height - 25))
         {
             flagPole.Flag.Location = new Vector2(flagPole.Flag.Location.X, flagPole.Flag.Location.Y + 2);
         }
         else if (flagPole.Flag.Location.Y >= (flagPole.Location.Y + flagPole.Hitbox.Height - 25) && mario.Location.Y >= (flagPole.Location.Y + flagPole.Hitbox.Height - marioCollision.Hitbox.Height))
         {
             if (mario.Location.X < LEVEL_BARRIER)
             {
                 mario.RunRight();
                 if (mario.MovementState is MarioFlagState)
                 {
                     SoundFactory.Instance.PlaySong("MUSIC_WORLD_CLEAR");
                     mario.Jump();
                 }
             }
             else
             {
                 mario.Idle();
             }
         }
         levelTimeOut--;
     }
     else
     {
         SuperPixelBrosGame.ResetLevel();
         game.GameState = new MarioStartLevelState(game, controllerList, camera);
         SoundFactory.Instance.PlayBackgroundMusic();
     }
 }
예제 #3
0
 public PauseCommand(SuperPixelBrosGame SuperPixelBrosGame)
 {
     this.SuperPixelBrosGame = SuperPixelBrosGame;
 }
예제 #4
0
 public void Execute()
 {
     SuperPixelBrosGame.ResetLevel();
 }
예제 #5
0
 public AbstractGameState(SuperPixelBrosGame game, ArrayList controllerList, ICamera camera)
 {
     this.game           = game;
     this.controllerList = controllerList;
     this.camera         = camera;
 }
예제 #6
0
 static void Main()
 {
     using (var game = new SuperPixelBrosGame())
         game.Run();
 }
예제 #7
0
 public CodeEntryCommand(SuperPixelBrosGame SuperPixelBrosGame, PasswordInputController controller)
 {
     this.SuperPixelBrosGame = SuperPixelBrosGame;
     this.controller         = controller;
 }
예제 #8
0
 public PauseController(SuperPixelBrosGame SuperPixelBrosGame)
 {
     commandDictionary       = new Dictionary <string, ICommand>();
     this.SuperPixelBrosGame = SuperPixelBrosGame;
 }
예제 #9
0
 public QuitCommand(SuperPixelBrosGame SuperPixelBrosGame)
 {
     this.SuperPixelBrosGame = SuperPixelBrosGame;
 }