public void OnCollision(Direction direction, SpriteCollection other, Rectangle intersection) { if (other is SpriteMario) { SpriteMario mario = other as SpriteMario; SpriteLayer.CollisionLayer.RemoveSprite(this); if (this.oneUp) { mario.lives++; SoundFactory.PlaySoundEffect(SoundFactory.OneUp()); } else { mario.StateMachinePowerup.CurrentState.ReceiveMushroom(); mario.points += 1000; this.game.pointGenerator.Add(1000, mario); } } }