public override void CollisionResponseTop(ICollidable collidable) { if (collidable is MarioModel) { MarioModel mario = (MarioModel)collidable; mario.TakeDamage(); } }
public Camera(Viewport viewport, MarioModel mario) { this.observers = new List <ICameraObserver>(); this.mario = mario; _viewport = viewport; Origin = new Vector2(_viewport.Width / 2.0f, _viewport.Height / 2.0f); Zoom = 1.0f; }
public override void CollisionResponseSide(ICollidable collidable) { if (collidable is MarioModel && !HasCollided) { MarioModel marioModel = (MarioModel)collidable; RewardPointsByHeight(marioModel); CurrentState.BumpTransition(); HasCollided = true; //Call Finalize Points ICommand com = new GoToCastleCommand(marioModel); com.Execute(); winTime.Start(); } }
public override void CollisionResponseTop(ICollidable collidable) { if (collidable is MarioModel && !HasCollided) { //If mario hits top of flag, give an extra life MarioModel marioModel = (MarioModel)collidable; marioModel.lives++; CurrentState.BumpTransition(); HasCollided = true; //Call Finalize Points ICommand com = new GoToCastleCommand(marioModel); com.Execute(); winTime.Start(); } }
public override void CollisionResponseBottom(ICollidable collidable) { if (collidable is MarioModel) { MarioModel marioModel = (MarioModel)collidable; if (NumOfItems > 0) { //Move the item ItemModel = ItemModelFactory.GetItemModel(ItemType, Position, Velocity); //AddItemsButCoinAsCollidable(); ItemModel.Move(Position, marioModel.leftFacing); //If items still exist inside brick, bump the brick. this.CurrentState.BumpTransition(); NumOfItems--; } } }
public void RewardPointsByHeight(MarioModel marioModel) { //Cooridnates start from top left of the flag float coorY = Coordinates.Y; float marioY = marioModel.Position.Y; //Based on where the Y position of Mario is relative to flag's coordinates, award different points if (marioY <= coorY + 25) { //Top side of Flag pole (128-153 Pixels high). NOT TOP TOP of flag pole though. //Give 4000 Points marioModel.points += 4000; } else if (marioY <= coorY + 70) { //2nd Top side of Flag pole (82-127 Pixels high) //Give 2000 Points marioModel.points += 2000; } else if (marioY <= coorY + 93) { //3rd Top side of Flag pole (58-81 Pixels high) //Give 800 Points marioModel.points += 800; } else if (marioY <= coorY + 132) { //2nd Bottom side of Flag pole (18-57 Pixels high) //Give 400 Points marioModel.points += 400; } else if (marioY <= coorY + 153) { //Bottom side of Flag pole (0-17 Pixels high) //Give 100 Points marioModel.points += 100; } //Finally multiply the points by time remaining //MarioModel needs access to read time. marioModel.points += marioModel.time * 50; marioModel.time = 400; }
public MoveLeftCommand(MarioModel mario) { this.mario = mario; }
public StopJumpCommand(MarioModel mario) { this.mario = mario; }
public FireCommand(MarioModel receiver) { this.receiver = receiver; }
public StopCrouchCommand(MarioModel mario) { this.mario = mario; }
public GoToCastleCommand(MarioModel receiver) { this.receiver = receiver; }
public ToTestRoomCommand(MarioModel receiver) { this.receiver = receiver; }
public MarioFireState(MarioModel mario) : base(mario) { }
public MarioDeadState(MarioModel mario) : base(mario) { }
public MarioStandardState(MarioModel mario) : base(mario) { }
public SuperCommand(MarioModel receiver) { this.receiver = receiver; }
public StandardCommand(MarioModel receiver) { this.receiver = receiver; }
public StopRightCommand(MarioModel mario) { this.mario = mario; }
public MoveRightCommand(MarioModel mario) { this.mario = mario; }
public StopLeftCommand(MarioModel mario) { this.mario = mario; }
public TakeDamageCommand(MarioModel mario) { this.mario = mario; }
public FeatureToggleCommand(MarioModel receiver) { this.receiver = receiver; }
public MarioPowerupStatesAbstract(MarioModel mario) { Mario = mario; }
public ToggleCrouchCommand(MarioModel mario) { this.mario = mario; }
public MarioSuperState(MarioModel mario) : base(mario) { }
public ToggleGravityCommand(MarioModel receiver) { this.receiver = receiver; }