Exemple #1
0
        public void Set(BoxSprite.Name name, float x, float y, float width, float height, Azul.Color pLineColor = null)
        {
            Debug.Assert(this.poBoxSprite != null);
            Debug.Assert(this.poLineColor != null);

            Debug.Assert(poScreenRect != null);
            BoxSprite.poScreenRect.Set(x, y, width, height);

            this.name = name;

            if (pLineColor != null)
            {
                this.poLineColor.Set(pLineColor);
                this.poBoxSprite.SwapColor(this.poLineColor);
            }

            this.poBoxSprite.SwapScreenRect(poScreenRect);
            Debug.Assert(this.poBoxSprite != null);

            this.x     = poBoxSprite.x;
            this.y     = poBoxSprite.y;
            this.sx    = poBoxSprite.sx;
            this.sy    = poBoxSprite.sy;
            this.angle = poBoxSprite.angle;
        }
        //---------------------------------------------------------------------------------------------------------
        // Methods
        //---------------------------------------------------------------------------------------------------------
        public void set(BoxSprite.Name name, float x, float y, float width, float height, Azul.Color pColor)
        {
            Debug.Assert(this.poAzulBoxSprite != null);
            Debug.Assert(this.poAzulColor != null);

            Debug.Assert(psAzulRect != null);
            BoxSprite.psAzulRect.Set(x, y, width, height);

            this.name = name;

            if (pColor == null)
            {
                this.poAzulColor.Set(1, 1, 1);
            }
            else
            {
                this.poAzulColor.Set(pColor);
            }

            this.poAzulBoxSprite.Swap(psAzulRect, this.poAzulColor);
            Debug.Assert(this.poAzulBoxSprite != null);

            this.x     = poAzulBoxSprite.x;
            this.y     = poAzulBoxSprite.y;
            this.sx    = poAzulBoxSprite.sx;
            this.sy    = poAzulBoxSprite.sy;
            this.angle = poAzulBoxSprite.angle;
        }
Exemple #3
0
 public Missile(GameObject.Name name, Sprite.Name spriteName, BoxSprite.Name boxSpriteName, float posX, float posY)
     : base(name, spriteName, boxSpriteName)
 {
     this.x      = posX;
     this.y      = posY;
     this.speedY = 10.0f;
 }
        public void Set(BoxSprite.Name name, float x, float y, float width, float height, Azul.Color pLineColor)
        {
            //created in the constructor, double-check
            Debug.Assert(this.poAzulSpriteBox != null);
            Debug.Assert(this.poLineColor != null);

            Debug.Assert(psTempRect != null);
            psTempRect.Set(x, y, width, height);

            this.name = name;

            if (pLineColor == null)
            {
                this.poLineColor.Set(1, 1, 1);
            }

            else
            {
                this.poLineColor.Set(pLineColor);
            }

            this.poAzulSpriteBox.Swap(psTempRect, this.poLineColor);
            Debug.Assert(poAzulSpriteBox != null);

            this.x     = poAzulSpriteBox.x;
            this.y     = poAzulSpriteBox.y;
            this.sx    = poAzulSpriteBox.sx;
            this.sy    = poAzulSpriteBox.sy;
            this.angle = poAzulSpriteBox.angle;
        }
Exemple #5
0
        public void Set(BoxSprite.Name name, Azul.Color pLineColor = null)
        {
            Debug.Assert(this.poBoxSprite != null);
            Debug.Assert(this.poLineColor != null);

            Debug.Assert(poScreenRect != null);

            this.name = name;

            if (pLineColor == null)
            {
                this.poLineColor.Set(1, 1, 1);
            }
            else
            {
                this.poLineColor.Set(pLineColor);
            }

            this.poBoxSprite.SwapColor(this.poLineColor);
            Debug.Assert(this.poBoxSprite != null);

            this.x     = poBoxSprite.x;
            this.y     = poBoxSprite.y;
            this.sx    = poBoxSprite.sx;
            this.sy    = poBoxSprite.sy;
            this.angle = poBoxSprite.angle;
        }
Exemple #6
0
 public LargeInvader(GameObject.Name name, Sprite.Name spriteName, BoxSprite.Name boxSpriteName, float posX, float posY)
     : base(name, spriteName, boxSpriteName)
 {
     this.x     = posX;
     this.y     = posY;
     this.value = 10;
 }
Exemple #7
0
        //---------------------------------------------------------------------------------------------------------
        // Methods
        //---------------------------------------------------------------------------------------------------------

        //public void ToggleColor()
        //{
        //    if (GameObjectMan.GetShowColBox() == true)
        //    {
        //        this.poLineColor.Set(this.poLineColorHolder);
        //    }
        //    else
        //    {
        //        this.poLineColor.Set(BoxSprite.psTmpColor);
        //    }
        //}

        public void Set(BoxSprite.Name name, float x, float y, float width, float height, Azul.Color pLineColor)
        {
            Debug.Assert(this.poAzulSpriteBox != null);
            Debug.Assert(this.poLineColor != null);

            Debug.Assert(psTmpRect != null);
            BoxSprite.psTmpRect.Set(x, y, width, height);

            this.name = name;

            if (pLineColor == null)
            {
                this.poLineColor.Set(0, 0, 0);
            }
            else
            {
                this.poLineColor.Set(pLineColor);
            }

            //this.poLineColorHolder = poLineColor;
            this.poAzulSpriteBox.Swap(psTmpRect, this.poLineColor);
            Debug.Assert(this.poAzulSpriteBox != null);

            this.BaseSet(poAzulSpriteBox.x, poAzulSpriteBox.y, poAzulSpriteBox.sx, poAzulSpriteBox.sy, poAzulSpriteBox.angle);
        }
        public WallRight(GameObject.Name name, Sprite.Name spriteName, BoxSprite.Name boxSpriteName, float posX, float posY, float width, float height)
            : base(name, spriteName, boxSpriteName)
        {
            this.poColObj.poColRect.Set(posX, posY, width, height);

            this.x = posX;
            this.y = posY;
        }
Exemple #9
0
 public UFO(GameObject.Name name, Sprite.Name spriteName, BoxSprite.Name boxSpriteName, float posX, float posY)
     : base(name, spriteName, boxSpriteName)
 {
     this.x      = posX;
     this.y      = posY;
     this.speedX = 2;
     this.value  = 300;
 }
Exemple #10
0
 public Bomb(GameObject.Name name, Sprite.Name spriteName, BoxSprite.Name boxSpriteName, float posX, float posY)
     : base(name, spriteName, boxSpriteName)
 {
     this.x      = posX;
     this.y      = posY;
     this.speedY = -5.0f;
     this.pInvaderWhoDroppedMe = null;
 }
Exemple #11
0
        public Ship(GameObject.Name name, Sprite.Name spriteName, BoxSprite.Name boxSpriteName, float posX, float posY)
            : base(name, spriteName, boxSpriteName)
        {
            this.x = posX;
            this.y = posY;

            this.speedX       = 5.0f;
            this.pMotionState = null;
            this.pShootState  = null;
        }
        public void Set(BoxSprite.Name name)
        {
            this.name = ProxyBoxSprite.Name.Proxy;

            this.x = 0.0f;
            this.y = 0.0f;

            this.pBoxSprite = BoxSpriteManager.Find(name);
            Debug.Assert(this.pBoxSprite != null);
        }
Exemple #13
0
 public void Set(BoxSprite.Name boxName, Azul.Rect pRect)
 {
     Debug.Assert(pRect != null);
     this.name = boxName;
     this.poBoxSprite.SwapScreenRect(pRect);
     this.x     = poBoxSprite.x;
     this.y     = poBoxSprite.y;
     this.sx    = poBoxSprite.sx;
     this.sy    = poBoxSprite.sy;
     this.angle = poBoxSprite.angle;
 }
        public static BoxSprite Find(BoxSprite.Name name)
        {
            BoxSpriteMan pBSMan = BoxSpriteMan.PrivGetInstance();

            Debug.Assert(pBSMan != null);

            pBSMan.poNodeCompare.SetName(name);

            BoxSprite pBSnode = (BoxSprite)pBSMan.BaseFind(pBSMan.poNodeCompare);

            return(pBSnode);
        }
Exemple #15
0
        public static BoxSprite Find(BoxSprite.Name name)
        {
            //ensure call Create() first
            BoxSpriteMan pMan = BoxSpriteMan.GetInstance();

            Debug.Assert(pMan != null);

            pMan.poNodeForCompare.setName(name);
            BoxSprite pData = (BoxSprite)pMan.baseFind(pMan.poNodeForCompare);

            return(pData);
        }
        public static BoxSprite Find(BoxSprite.Name name)
        {
            BoxSpriteMan pMan = BoxSpriteMan.privGetInstance();

            Debug.Assert(pMan != null);

            pMan.poNodeCompare.SetName(name);

            BoxSprite pData = (BoxSprite)pMan.baseFind(pMan.poNodeCompare);

            return(pData);
        }
Exemple #17
0
        public static BoxSprite Find(BoxSprite.Name theName)
        {
            BoxSpriteManager pBoxMan = BoxSpriteManager.privGetInstance();

            Debug.Assert(pBoxMan != null);

            pBoxMan.poNodeCompare.SetName(theName);

            BoxSprite pBoxSprite = (BoxSprite)pBoxMan.baseFind(pBoxMan.poNodeCompare);

            return(pBoxSprite);
        }
Exemple #18
0
        public static BoxSprite Add(BoxSprite.Name theName, float x, float y, float width, float height, Azul.Color pColor = null)
        {
            BoxSpriteManager pBoxMan = BoxSpriteManager.privGetInstance();

            Debug.Assert(pBoxMan != null);

            BoxSprite pNode = (BoxSprite)pBoxMan.baseAdd();

            Debug.Assert(pNode != null);

            pNode.Set(theName, x, y, width, height, pColor);
            return(pNode);
        }
Exemple #19
0
        public static BoxSprite Find(BoxSprite.Name name)
        {
            BoxSpriteManager pMan = BoxSpriteManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            pMan.poNodeCompare.name = name;

            BoxSprite pData = (BoxSprite)pMan.BaseFind(pMan.poNodeCompare);

            Debug.Assert(pData != null);
            return(pData);
        }
        public static BoxSprite Add(BoxSprite.Name name, float x, float y, float width, float height, Azul.Color pColor = null)
        {
            BoxSpriteMan pBSMan = BoxSpriteMan.PrivGetInstance();

            Debug.Assert(pBSMan != null);

            BoxSprite pBSnode = (BoxSprite)pBSMan.BaseAdd();

            Debug.Assert(pBSnode != null);

            pBSnode.Set(name, x, y, width, height, pColor);
            return(pBSnode);
        }
Exemple #21
0
        public static BoxSprite Add(BoxSprite.Name name, Azul.Color pColor = null)
        {
            BoxSpriteManager pMan = BoxSpriteManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            BoxSprite pNode = (BoxSprite)pMan.BaseAdd();

            Debug.Assert(pNode != null);

            pNode.Set(name, pColor);

            return(pNode);
        }
Exemple #22
0
        public BoxSprite GetSpriteByName(BoxSprite.Name n)
        {
            BoxSprite current = (BoxSprite)this.poActiveHead;

            while (current != null)
            {
                if (current.name == n)
                {
                    return(current);
                }
            }

            return(null);
        }
Exemple #23
0
        public static BoxSprite Add(BoxSprite.Name name, Azul.Rect pRect)
        {
            BoxSpriteManager pMan = BoxSpriteManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            BoxSprite pNode = (BoxSprite)pMan.BaseAdd();

            Debug.Assert(pNode != null);

            // Initialize the Data
            pNode.Set(name, pRect);
            return(pNode);
        }
Exemple #24
0
        protected GameObject(GameObject.Name name, Sprite.Name spriteName, BoxSprite.Name boxSpriteName)
        {
            this.name   = name;
            this.x      = 0.0f;
            this.y      = 0.0f;
            this.speedX = 0;
            this.speedY = 0;

            this.pProxySprite = new ProxySprite(spriteName);
            Debug.Assert(this.pProxySprite != null);

            this.poColObj = new ColObject(this.pProxySprite, boxSpriteName);
            Debug.Assert(this.poColObj != null);
        }
Exemple #25
0
        public static BoxSprite Find(BoxSprite.Name name)
        {
            BoxSpriteManager pMan = BoxSpriteManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            // So:  Use the Compare Node - as a reference
            //      use in the Compare() function
            pMan.poNodeCompare.SetName(name);

            BoxSprite pData = (BoxSprite)pMan.BaseFind(pMan.poNodeCompare);

            return(pData);
        }
Exemple #26
0
        public static BoxSprite Add(BoxSprite.Name name, float x, float y, float width, float height, Azul.Color pColor = null)
        {
            BoxSpriteManager pMan = BoxSpriteManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            BoxSprite pNode = (BoxSprite)pMan.BaseAdd();

            Debug.Assert(pNode != null);

            // Initialize the Data
            pNode.Set(name, x, y, width, height, pColor);
            return(pNode);
        }
        // TODO right now proxies are not being added to the manager
        public static ProxyBoxSprite Add(BoxSprite.Name name)
        {
            ProxyBoxSpriteManager pMan = ProxyBoxSpriteManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            ProxyBoxSprite pNode = (ProxyBoxSprite)pMan.BaseAdd();

            Debug.Assert(pNode != null);

            pNode.Set(name);

            return(pNode);
        }
Exemple #28
0
        private void Set(BoxSprite.Name boxName, float x, float y, float width, float height)
        {
            Debug.Assert(this.poAzulSpriteBox != null);
            Debug.Assert(this.poLineColor != null);

            Debug.Assert(psTmpRect != null);
            BoxSprite.psTmpRect.Set(x, y, width, height);

            this.name = boxName;

            this.poAzulSpriteBox.Swap(psTmpRect, this.poLineColor);
            Debug.Assert(this.poAzulSpriteBox != null);

            this.BaseSet(poAzulSpriteBox.x, poAzulSpriteBox.y, poAzulSpriteBox.sx, poAzulSpriteBox.sy, poAzulSpriteBox.angle);
        }
Exemple #29
0
        public static BoxSprite Add(BoxSprite.Name name, float x, float y, float width, float height, Azul.Color pColor = null)
        {
            //ensure call Create() first
            BoxSpriteMan pMan = BoxSpriteMan.GetInstance();

            Debug.Assert(pMan != null);

            BoxSprite pBoxSprite = (BoxSprite)pMan.baseAdd();

            Debug.Assert(pBoxSprite != null);

            pBoxSprite.set(name, x, y, width, height, pColor);

            return(pBoxSprite);
        }
Exemple #30
0
        public static BoxSprite Find(BoxSprite.Name name)
        {
            BoxSpriteMan pMan = BoxSpriteMan.PrivGetInstance();

            Debug.Assert(pMan != null);

            // Compare functions only compares two Nodes

            // So:  Use the Compare Node - as a reference
            //      use in the Compare() function
            pMan.poNodeCompare.name = name;

            BoxSprite pData = (BoxSprite)pMan.BaseFind(pMan.poNodeCompare);

            return(pData);
        }