Exemple #1
0
        private void DiscloseItem()
        {
            ItemCharacter       item = (ItemCharacter)items[0];
            ItemBumpingCommands bumpItem;

            SoundFactory.Instance.BumpItems();
            if (item is RandomItemCharacter || item is JumpMedicineCharacter)
            {
                item.Bumping(bPosition, bPosition.Y, bPosition.Y, spriteSpeed);
            }
            else
            {
                switch (item.Type)
                {
                case Sprint5Main.CharacterType.Coin:
                    bumpItem = new CoinBumping(item, bPosition, bPosition.Y - 3.0f * this.GetHeightAndWidth.X, bPosition.Y, spriteSpeed);
                    bumpItem.HandleBumping();
                    break;

                case Sprint5Main.CharacterType.Flower:
                    bumpItem = new FlowerBumping(item, bPosition, bPosition.Y, bPosition.Y, spriteSpeed);
                    bumpItem.HandleBumping();
                    break;

                case Sprint5Main.CharacterType.RedMushroom:
                case Sprint5Main.CharacterType.GreenMushroom:
                    bumpItem = new MushroomBumping(item, bPosition, bPosition.Y - 1.0f * this.GetHeightAndWidth.X, bPosition.Y, spriteSpeed);
                    bumpItem.HandleBumping();
                    break;

                case Sprint5Main.CharacterType.Star:
                    bumpItem = new StarBumping(item, bPosition, bPosition.Y - 2.0f * this.GetHeightAndWidth.X, bPosition.Y, spriteSpeed);
                    bumpItem.HandleBumping();
                    break;
                }
            }
        }
 public void HandleBumping()
 {
     item.Bumping(startPos, minY, startHeight, speed);
 }