예제 #1
0
 public override void Bump(IMario Mario)
 {
     ElapsedTime = 0;
     IsBumped    = true;
     Bumper      = Mario;
     if (!Mario.CanBreakBlocks() && Item == Items.Default)
     {
         Location        = new Vector2(Location.X, Location.Y - bumpVelocity);
         Sprite.Location = Location;
         new SoundEffects().PlayBump();
     }
     else if (Mario.CanBreakBlocks() && Item == Items.Default)
     {
         Location        = new Vector2(Location.X, Location.Y - bumpVelocity);
         Sprite.Location = Location;
         DeleteBlock     = true;
         new SoundEffects().PlayBreakBlock();
     }
     else
     {
         Location        = new Vector2(Location.X, Location.Y - bumpVelocity);
         Sprite.Location = Location;
         OpenedBlock.SpawnItem(Bumper, Item, this);
         new OpenBlockCommand(this).Execute();
     }
     OnBump += BreakableBlock_OnBump;
 }
예제 #2
0
 public Boolean CanBreakBlocks()
 {
     return(mario.CanBreakBlocks());
 }