示例#1
0
        public UFO createUFO(UFO.UFOType mUfoType, GameObject.GameObjectName gameName, int index = 0, float mX = 0.0f, float mY = 0.0f)
        {
            UFO ufo = null;

            switch (mUfoType)
            {
            case UFO.UFOType.UFORoot:
                ufo = new UFORoot(gameName, Sprite.SpriteName.NullObject, index, mX, mY, UFO.UFOType.UFORoot);
                GameObjectNodeManager.add(ufo, cPCSTree);
                break;

            case UFO.UFOType.AlienUFO:
                ufo = new AlienUFO(gameName, Sprite.SpriteName.AlienUFO, index, mX, mY, UFO.UFOType.AlienUFO);
                break;

            case UFO.UFOType.Uninitilized:
                Debug.WriteLine("ufo Type is Uninitilized");
                break;
            }

            this.cPCSTree.Insert(ufo, this.cParent);
            ufo.addSpriteToBatch(this.cSpriteBatch);
            ufo.addCollisionToBatch(SpriteBatchManager.find(SpriteBatch.SpriteBatchName.Boxes));
            return(ufo);
        }
示例#2
0
 public UFORoot(GameObject.GameObjectName mGameObjectName, Sprite.SpriteName mSpriteName, int index, float mX, float mY, UFO.UFOType ufoType) : base(mGameObjectName, index, mSpriteName, ufoType)
 {
     this.x         = mX;
     this.y         = mY;
     this.ufoDeltaX = Unit.ufoDeltaX;
     //   this.cCollisionObj.cSpriteBox.setColor(Unit.spriteBoxColor);
 }
示例#3
0
 public UFO(GameObject.GameObjectName mGameObjectName, int index, Sprite.SpriteName mSpriteName, UFO.UFOType ufoType) : base(mGameObjectName, index, mSpriteName)
 {
     this.type   = ufoType;
     this.launch = false;
 }
示例#4
0
 public AlienUFO(GameObject.GameObjectName mGameObjectName, Sprite.SpriteName mSpriteName, int index, float mX, float mY, UFO.UFOType ufoType) : base(mGameObjectName, index, mSpriteName, ufoType)
 {
     this.deltaX = Unit.ufoDeltaX;
     this.setX(mX);
     this.setY(mY);
     //    this.cCollisionObj.cSpriteBox.setColor(Unit.spriteBoxColor);
     this.launch = false;
 }