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); }
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); }
public UFO(GameObject.GameObjectName mGameObjectName, int index, Sprite.SpriteName mSpriteName, UFO.UFOType ufoType) : base(mGameObjectName, index, mSpriteName) { this.type = ufoType; this.launch = false; }
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; }