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 void Execute() { SuperPixelBrosGame.ResetLevel(); }