Exemple #1
0
        public bool CollidesCharacterWithItemsB(MainCharacterB characterB)
        {
            int  pos      = 0;
            bool collided = false;

            while (pos < items.Count && !collided)
            {
                if (characterB.CollidesWith(items[pos]))
                {
                    collided = true;
                    items.RemoveAt(pos);
                }
                pos++;
            }
            return(collided);
        }
Exemple #2
0
        public ushort CollidesCharacterBWith1_UPItem(MainCharacterB characterB)
        {
            int    pos    = 0;
            ushort result = 0;

            while (pos < items.Count && result == 0)
            {
                if (characterB.CollidesWith(items[pos]))
                {
                    result += items[pos].Lives;
                    items.RemoveAt(pos);
                }
                pos++;
            }
            return(result);
        }