Esempio n. 1
0
 public GridNode(Azul.Color colColor, GameObject.Name name, Index index = Index.Index_Null)
     : base(colColor, name, index)
 {
     this.deltaX = 10.0f;
     this.deltaY = -30.0f;
     moveVert = false;
 }
Esempio n. 2
0
 protected Hierarchy(Azul.Color colColor, GameObject.Name typeName, Index index = Index.Index_Null)
     : base(typeName, SpriteEnum.Null, index, new Azul.Color(0f, 0f, 0f), colColor, 0.0f, 0.0f)
 {
     this.type = typeName;
     this.index = index;
     this.sprite = new ProxySprite(SpriteEnum.Null, index, 0.0f, 0.0f);
 }
        public static CollisionPair add(CollisionPair.Type type, GameObject.Name tA, GameObject.Name tB)
        {
            CollisionPair pair = (CollisionPair)Instance.baseAdd();

            pair.set(type, tA, tB);

            return pair;
        }
Esempio n. 4
0
 public GameObject(GameObject.Name goName, SpriteEnum name, Index index, Azul.Color color, Azul.Color colColor, float x, float y)
 {
     this.colObj = new CollisionObject(name, index, colColor);
     this.goColor = color;
     this.name = goName;
     this.index = index;
     this.x = x;
     this.y = y;
     angle = 0.0f;
     sx = 1;
     sy = 1;
 }
Esempio n. 5
0
        public void notifyObservers(GameObject obj1, GameObject obj2)
        {
            this.obj1 = obj1;
            this.obj2 = obj2;

            Observer currObv = observerList;
            while (currObv != null)
            {
                currObv.notify();

                currObv = currObv.Next;
            }
        }
Esempio n. 6
0
        public void collision(GameObject nodeA, GameObject nodeB)
        {
            GameObject currA = nodeA;
            GameObject currB = nodeB;

            while (currA != null)
            {
                currB = nodeB;
                while (currB != null)
                {
                    if (intersect(currA, currB))
                    {
                        currA.accept(currB, this);
                        return;
                    }

                    currB = (GameObject)currB.Sibling;
                }

                currA = (GameObject)currA.Sibling;
            }
            collided = false;
        }
        public ReverseTreeIterator(TreeNode root)
        {
            Debug.Assert(root != null);
            treeRoot = (GameObject)root;
            current = (GameObject)root;

            GameObject go = treeRoot;
            GameObject node = go;

            while (go != null)
            {
                node = go;
                go = this.next();

                if (go != null)
                {
                    go.Reverse = node;
                }

            }

            this.treeRoot = node;
            this.current = node;
        }
        private GameObject next()
        {
            this.current = getNext(this.current);

            return this.current;
        }
Esempio n. 9
0
 public WallNode(Azul.Color colColor, GameObject.Name name, Index index = Index.Index_Null)
     : base(colColor, name, index)
 {
 }
        public GameObject first()
        {
            this.current = this.treeRoot;

            return (GameObject)this.current;
        }
 public void moveNext()
 {
     this.current = (GameObject)this.current.Reverse;
 }
Esempio n. 12
0
        private void processTree(GameObject treeNode)
        {
            TreeNode child = null;

            if (!moveVert)
            {
                float x = treeNode.getX() + deltaX;
                treeNode.setX(x);
            }
            else
            {
                float y = treeNode.getY() + this.deltaY;
                treeNode.setY(y);
            }

            if (treeNode.Child != null)
            {
                child = treeNode.Child;

                while (child != null)
                {
                    processTree((GameObject)child);

                    child = child.Sibling;
                }

            }
        }
Esempio n. 13
0
 public SpawnBomb()
 {
     name = GameObject.Name.Not_Initialized;
     index = Index.Index_Null;
     alienTree = null;
 }
 public static void addRoot(GameObject gameObj)
 {
     GameObjectNode spr = (GameObjectNode)Instance.baseAdd();
     // Setting the default position of the ProxySprite
     spr.set(gameObj);
 }
Esempio n. 15
0
 public static void setRoot(GameObject root)
 {
     Instance.root = root;
 }
Esempio n. 16
0
 public Squid(GameObject.Name goName, SpriteEnum sName, Index index, float x, float y)
     : base(goName, sName, index, x, y)
 {
 }
Esempio n. 17
0
 public void set(GridNode gridNode, GameObject.Name name, Index index = Index.Index_Null)
 {
     this.gridRoot = gridNode;
     this.name = name;
     this.index = index;
 }
Esempio n. 18
0
 public void moveNext()
 {
     this.current = getNext(current);
 }
Esempio n. 19
0
 public TreeIterator(GameObject root)
 {
     this.treeRoot = root;
     this.current = this.treeRoot;
 }
Esempio n. 20
0
 public GameObjectNode()
 {
     go = null;
     name = GameObject.Name.Not_Initialized;
     index = Index.Index_Null;
 }
Esempio n. 21
0
 public Octopus(GameObject.Name goName, Index index, SpriteEnum sName, float x, float y)
     : base(goName, sName, index, x, y)
 {
 }
Esempio n. 22
0
 public void set(Type t, GameObject.Name tA, GameObject.Name tB)
 {
     this.treeA = GameObjectManager.find(tA);
     this.treeB = GameObjectManager.find(tB);
     this.type = t;
     this.subject = new ColSubject();
     collided = false;
 }
Esempio n. 23
0
        public static void createShield(GameObject.Name shield, float x, float y)
        {
            float baseX = x;
            float baseY = y;
            const float blockWidth = 15f - 1f;
            const float blockHeight = 5f;
            float offsetX = 0f;

            int numIndex = 0;

            // Column 1
            Hierarchy shieldCol = HierarchyFactory.create(Hierarchy.ShieldCol.Column, new Azul.Color(1f, 1f, 0f));
            ShieldFactory.setRoot(shieldCol);
            ShieldFactory.create(ShieldBlock.LeftTopBlock.LeftTop, Index.Index_1, baseX, baseY + 13 * blockHeight);
            ShieldFactory.create(ShieldBlock.LeftTopBlock.LeftTop, Index.Index_0, baseX, baseY + 12 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX, baseY + 11 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX, baseY + 10 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX, baseY + 9 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX, baseY + 8 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX, baseY + 7 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX, baseY + 6 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX, baseY + 5 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX, baseY + 4 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX, baseY + 3 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX, baseY + 2 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX, baseY + blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX, baseY);

            // Column 2
            offsetX += blockWidth - 1;
            shieldCol = HierarchyFactory.create(Hierarchy.ShieldCol.Column, new Azul.Color(1f, 1f, 0f));
            ShieldFactory.setRoot(shieldCol);
            ShieldFactory.create(ShieldBlock.LeftTopBlock.LeftTop, Index.Index_3, baseX + offsetX, baseY + 15 * blockHeight);
            ShieldFactory.create(ShieldBlock.LeftTopBlock.LeftTop, Index.Index_2, baseX + offsetX, baseY + 14 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 13 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 12 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 11 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 10 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 9 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 8 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 7 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 6 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 5 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 4 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 3 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 2 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY);

            // Column 3
            offsetX += blockWidth;
            shieldCol = HierarchyFactory.create(Hierarchy.ShieldCol.Column, new Azul.Color(1f, 1f, 0f));
            ShieldFactory.setRoot(shieldCol);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 15 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 14 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 13 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 12 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 11 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 10 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 9 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 8 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 7 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 6 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 5 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 4 * blockHeight);
            ShieldFactory.create(ShieldBlock.LeftBottomBlock.LeftBottom, Index.Index_1, baseX + offsetX, baseY + 3 * blockHeight);
            ShieldFactory.create(ShieldBlock.LeftBottomBlock.LeftBottom, Index.Index_0, baseX + offsetX, baseY + 2 * blockHeight);

            // Column 4
            offsetX += blockWidth;
            shieldCol = HierarchyFactory.create(Hierarchy.ShieldCol.Column, new Azul.Color(1f, 1f, 0f));
            ShieldFactory.setRoot(shieldCol);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 15 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 14 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 13 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 12 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 11 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 10 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 9 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 8 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 7 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 6 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 5 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 4 * blockHeight);

            // Column 5
            offsetX += blockWidth;
            shieldCol = HierarchyFactory.create(Hierarchy.ShieldCol.Column, new Azul.Color(1f, 1f, 0f));
            ShieldFactory.setRoot(shieldCol);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 15 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 14 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 13 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 12 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 11 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 10 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 9 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 8 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 7 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 6 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 5 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 4 * blockHeight);

            // Column 6
            offsetX += blockWidth;
            shieldCol = HierarchyFactory.create(Hierarchy.ShieldCol.Column, new Azul.Color(1f, 1f, 0f));
            ShieldFactory.setRoot(shieldCol);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 15 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 14 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 13 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 12 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 11 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 10 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 9 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 8 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 7 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 6 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 5 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 4 * blockHeight);
            ShieldFactory.create(ShieldBlock.RightBottomBlock.RightBottom, Index.Index_0, baseX + offsetX, baseY + 3 * blockHeight);
            ShieldFactory.create(ShieldBlock.RightBottomBlock.RightBottom, Index.Index_1, baseX + offsetX, baseY + 2 * blockHeight);

            // Column 7
            offsetX += blockWidth;
            shieldCol = HierarchyFactory.create(Hierarchy.ShieldCol.Column, new Azul.Color(1f, 1f, 0f));
            ShieldFactory.setRoot(shieldCol);
            ShieldFactory.create(ShieldBlock.RightTopBlock.RightTop, Index.Index_0, baseX + offsetX, baseY + 15 * blockHeight);
            ShieldFactory.create(ShieldBlock.RightTopBlock.RightTop, Index.Index_1, baseX + offsetX, baseY + 14 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 13 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 12 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 11 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 10 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 9 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 8 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 7 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 6 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 5 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 4 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 3 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 2 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY);

            // Column 8
            offsetX += blockWidth;
            shieldCol = HierarchyFactory.create(Hierarchy.ShieldCol.Column, new Azul.Color(1f, 1f, 0f));
            ShieldFactory.setRoot(shieldCol);
            ShieldFactory.create(ShieldBlock.RightTopBlock.RightTop, Index.Index_2, baseX + offsetX, baseY + 13 * blockHeight);
            ShieldFactory.create(ShieldBlock.RightTopBlock.RightTop, Index.Index_3, baseX + offsetX, baseY + 12 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 11 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 10 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 9 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 8 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 7 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 6 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 5 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 4 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 3 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + 2 * blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY + blockHeight);
            ShieldFactory.create(ShieldBlock.Block.Block, Index.Index_0 + numIndex++, baseX + offsetX, baseY);
        }
Esempio n. 24
0
        public static void attach(GameObject go)
        {
            GameObjectNode node = (GameObjectNode)Instance.baseAdd();

            node.set(go);
        }
Esempio n. 25
0
 public Alien(GameObject.Name goName, SpriteEnum sprName, Index index, float x, float y)
     : base(goName, sprName, index, new Azul.Color(1f, 1f, 1f), new Azul.Color(1.0f, 0.0f, 0.0f), x, y)
 {
     sprite = new ProxySprite(sprName, index, x, y);
 }
Esempio n. 26
0
 public SpawnBomb(GameObject.Name obj, Index index = Index.Index_Null)
 {
     name = obj;
     this.index = index;
     alienTree = GameObjectManager.find(name, index);
 }
Esempio n. 27
0
 public Crab(GameObject.Name goName, Index index, SpriteEnum sName, float x, float y)
     : base(goName, sName, index, x, y)
 {
     //colObj.Bounds = this.sprite.
 }
        public static void removeNode(GameObject.Name tree, GameObject toRemove)
        {
            GameObject foundTree = GameObjectManager.find(tree);
            Debug.Assert(foundTree != null);

            TreeIterator it = new TreeIterator(foundTree);
            while (!it.atEnd())
            {
                if (it.getCurrent() == toRemove)
                {
                    GameObject obj = it.getCurrent();

                    // Child of parent removal
                    if (obj.Parent.Child == obj)
                    {
                        obj.Parent.Child = obj.Sibling;
                        obj.Sibling = null;
                    }
                    else
                    {
                        TreeNode node = obj.Parent.Child;
                        while (node != null && node.Sibling != obj)
                        {
                            node = node.Sibling;
                        }
                        Debug.Assert(node.Sibling == obj);

                        if (obj.Sibling != null)
                        {
                            node.Sibling = obj.Sibling;
                            obj.Sibling = null;
                        }
                        else
                        {
                            node.Sibling = null;
                        }
                    }

                    return;
                }

                it.moveNext();
            }
        }
 public static GameObject find(GameObject.Name goName, Index index = Index.Index_Null)
 {
     return ((GameObjectNode)Instance.baseFind(goName, index)).getGameObject();
 }
Esempio n. 30
0
 public void set(GameObject gObj)
 {
     go = gObj;
     name = (GameObject.Name)go.getName();
     index = go.getIndex();
 }