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"); }
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(); } }
public PauseCommand(SuperPixelBrosGame SuperPixelBrosGame) { this.SuperPixelBrosGame = SuperPixelBrosGame; }
public void Execute() { SuperPixelBrosGame.ResetLevel(); }
public AbstractGameState(SuperPixelBrosGame game, ArrayList controllerList, ICamera camera) { this.game = game; this.controllerList = controllerList; this.camera = camera; }
static void Main() { using (var game = new SuperPixelBrosGame()) game.Run(); }
public CodeEntryCommand(SuperPixelBrosGame SuperPixelBrosGame, PasswordInputController controller) { this.SuperPixelBrosGame = SuperPixelBrosGame; this.controller = controller; }
public PauseController(SuperPixelBrosGame SuperPixelBrosGame) { commandDictionary = new Dictionary <string, ICommand>(); this.SuperPixelBrosGame = SuperPixelBrosGame; }
public QuitCommand(SuperPixelBrosGame SuperPixelBrosGame) { this.SuperPixelBrosGame = SuperPixelBrosGame; }