Пример #1
0
        private void MoveDonw()
        {
            GameObject pAlienGroup = GameObjectMan.Find(GameObject.Name.AlienGroup);

            ReverseIterator pRev  = new ReverseIterator(pAlienGroup);
            Component       pNode = pRev.First();

            while (!pRev.IsDone())
            {
                GameObject pGameObj = (GameObject)pNode;

                float nextPosY = pGameObj.GetY() - 20;

                pGameObj.SetXY(pGameObj.GetX(), nextPosY);

                pNode = pRev.Next();
            }
        }
Пример #2
0
        public override void Move(float speedX, float speedY)
        {
            ReverseIterator pRev  = new ReverseIterator(this);
            Component       pNode = pRev.First();

            while (!pRev.IsDone())
            {
                GameObject pGameObj = (GameObject)pNode;
                if (pGameObj.holder == Container.LEAF)
                {
                    this.DropBomb(pGameObj);
                }

                float nextPosX = pGameObj.GetX() + (speedX * AlienGroup.moveDirectionX);
                //float nextPosY = pGameObj.GetY() + (speedY * AlienGroup.moveDirectionY);
                pGameObj.SetXY(nextPosX, pGameObj.GetY());

                pNode = pRev.Next();
            }

            //AlienGroup.moveDirectionY = 0;
        }