public override void ReleaseItem() { BrownMushroom brownMushroom = new BrownMushroom(new Vector2(this.block.Location().X, this.block.Location().Y - this.block.GetHitBox().Height)); Sound.SoundEffectManager.Instance.PlaySoundEffect(Sound.SoundEffectManager.SoundEffectTag.PowerUpAppears); GameManager.Instance.AddToCollidables(brownMushroom); brownMushroom.Physics.xVelocity = Config.GetItemMovementSpeed(); block.itemState = new EmptyItemState(block); }
public void Handle(ICollidable object1, ICollidable object2, CollisionDirection.DirectionTag direction) { if (typeof(IMario).IsInstanceOfType(object1) && typeof(BrownMushroom).IsInstanceOfType(object2)) { this.player = (IMario)object1; this.brownMushroom = (BrownMushroom)object2; //Mario should become big// player.CollectBrownMushroom(); //BrownMushroom disappear// this.brownMushroom.Collect(); } }