public MarioFinish(Mario mario, Game1 game, IBackground flag) : base(mario.Position, mario.Velocity, mario.Acceleration) { this.mario = mario; mario.Position = new Vector2(flag.Position.X + 2.5f, mario.Position.Y); Collision = new FinishCollision(); Movement = new FinishMovement(game); this.game = game; mario.UpReleased(); mario.Right(); if (mario.State.Name == "Big") { mario.State = new BigOnFlagState(mario); } else if (mario.State.Name == "Fire") { mario.State = new FireOnFlagState(mario); } else if (mario.State.Name == "Small") { mario.State = new SmallOnFlagState(mario); } foreach (IBackground ib in game.WorldLoader.Background) { if (ib is ToadCastle) { castle = (ToadCastle)ib; break; } } }
public MarioFinishCastle(Game1 game, Princess princess) : base(game.Mario.Position, game.Mario.Velocity, game.Mario.Acceleration) { if (game.Mario is MarioFinishCastle) { return; } this.mario = game.Mario; Collision = new FinishCollision(); Movement = new FinishMovement(); this.game = game; this.princess = princess; mario.UpReleased(); mario.Right(); }