示例#1
0
 public AxeEntity(Vector2 loc, EventSoundEffects sounds) : base(loc, sounds)
 {
     Sounds          = sounds;
     InitialPos      = loc;
     Sprite          = new Axe(loc);
     EntityCollision = new ItemCollision(this);
 }
示例#2
0
        protected override void CheckCollide(int offsetHeight1, int offsetHeight2)
        {
            base.CheckCollide(offsetHeight1, offsetHeight2);

            foreach (var item in level.CurrCollectable)
            {
                if (ItemCollision.IsTouchingItem(player.Rectangle, item.Rectangle) && !item.IsCollected)
                {
                    item.IsCollected = true;
                    ICollectMusic temp = effects as ICollectMusic;
                    switch (item.ItemType)
                    {
                    case CollectableTypes.BigHeart:
                    case CollectableTypes.SmallHeart:
                        temp.PlayHeartCollect();
                        player.Hearts += item.Value;
                        break;

                    case CollectableTypes.BigDiamond:
                    case CollectableTypes.SmallDiamond:
                        temp.PlayDiamondCollect();
                        player.Points += item.Value;
                        //Score verhogen.
                        break;

                    default:
                        break;
                    }
                }
            }
        }
示例#3
0
 public RedMushroomEntity(Vector2 loc, EventSoundEffects sounds) : base(loc, sounds)
 {
     Sounds          = sounds;
     Sound           = EventSoundEffects.EventSounds.CollectPowerUp;
     InitialPos      = loc;
     Sprite          = new RedMushroom(loc);
     EntityCollision = new ItemCollision(this);
     State           = new StandardItemState(this);
     State.NextState = new MovingItemState(this);
 }
示例#4
0
 public CoinEntity(Vector2 loc, EventSoundEffects sounds) : base(loc, sounds)
 {
     Sounds          = sounds;
     Sound           = EventSoundEffects.EventSounds.CollectCoin;
     InitialPos      = loc;
     Sprite          = new Coin(loc);
     EntityCollision = new ItemCollision(this);
     State           = new StandardItemState(this);
     State.NextState = new StandardItemState(this);
 }