Пример #1
0
        public Column(GameObject.GameObjectName mGameObjectName, Sprite.SpriteName mSpriteName, int index, float mX, float mY) : base(mGameObjectName, index, mSpriteName)
        {
            this.x = mX;
            this.y = mY;

            //  this.cCollisionObj.cSpriteBox.setColor(Unit.spriteBoxColor);
        }
Пример #2
0
        public Bomb createBomb(Bomb.BombType mBombType, GameObject.GameObjectName gameName, int index = 0, float mX = 0.0f, float mY = 0.0f)
        {
            Bomb bomb = null;

            switch (mBombType)
            {
            case Bomb.BombType.Flipping:
                bomb = new FlippingBomb(gameName, Sprite.SpriteName.Flipping, index, mX, mY, mBombType);
                break;

            case Bomb.BombType.ZigZag:
                bomb = new ZigZagBomb(gameName, Sprite.SpriteName.ZigZag, index, mX, mY, mBombType);
                break;

            case Bomb.BombType.Plunger:
                bomb = new PlungerBomb(gameName, Sprite.SpriteName.Plunger, index, mX, mY, mBombType);
                break;

            case Bomb.BombType.BombRoot:
                bomb = new BombRoot(gameName, Sprite.SpriteName.NullObject, index, mX, mY, mBombType);
                GameObjectNodeManager.add(bomb, cPCSTree);
                break;

            case Bomb.BombType.Uninitilized:
                Debug.WriteLine("Bomb Type is Uninitilized");
                break;
            }

            activate(bomb);
            return(bomb);
        }
Пример #3
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);
 }
Пример #4
0
 //public bool active;
 public FlippingBomb(GameObject.GameObjectName mGameObjectName, Sprite.SpriteName mSpriteName, int index, float mX, float mY, BombType bombType) : base(mGameObjectName, index, mSpriteName, bombType)
 {
     this.x      = mX;
     this.y      = mY;
     this.active = false;
     //  this.cCollisionObj.cSpriteBox.setColor(Unit.spriteBoxColor);
 }
Пример #5
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);
        }
Пример #6
0
        public Ship createShip(Ship.ShipType mShipType, GameObject.GameObjectName gameName, int index = 0, float mX = 0.0f, float mY = 0.0f)
        {
            Ship ship = null;

            switch (mShipType)
            {
            case Ship.ShipType.ShipRoot:
                ship = new ShipRoot(gameName, Sprite.SpriteName.NullObject, index, mX, mY);
                GameObjectNodeManager.add(ship, cPCSTree);
                break;

            case Ship.ShipType.CannonShip:
                ship = new CannonShip(gameName, Sprite.SpriteName.CannonShip, index, mX, mY);

                //   ship = cannonShip;
                break;

            case Ship.ShipType.Uninitilized:
                Debug.WriteLine("Missile Type is Uninitilized");
                break;
            }

            this.cPCSTree.Insert(ship, this.cParent);

            // cSpriteBatch.addToBatch(ship.getProxySprite());
            // cSpriteBatch.addToBatch(ship.getCollisionObj().cSpriteBox);
            ship.addSpriteToBatch(this.cSpriteBatch);
            ship.addCollisionToBatch(SpriteBatchManager.find(SpriteBatch.SpriteBatchName.Boxes));
            return(ship);
        }
Пример #7
0
        public Missile createMissile(Missile.MissileType mMissileType, GameObject.GameObjectName gameName, int index = 0, float mX = 0.0f, float mY = 0.0f)
        {
            Missile missile = null;

            switch (mMissileType)
            {
            case Missile.MissileType.MissileRoot:
                missile = new MissileRoot(gameName, Sprite.SpriteName.NullObject, index, mX, mY, Missile.MissileType.MissileRoot);
                GameObjectNodeManager.add(missile, cPCSTree);
                break;

            case Missile.MissileType.StraightMissile:
                missile = new StraightMissile(gameName, Sprite.SpriteName.StraightMissile, index, mX, mY, Missile.MissileType.StraightMissile);
                break;

            case Missile.MissileType.Uninitilized:
                Debug.WriteLine("Missile Type is Uninitilized");
                break;
            }

            this.cPCSTree.Insert(missile, this.cParent);
            //  cSpriteBatch.addToBatch(missile.getProxySprite());
            // cSpriteBatch.addToBatch(missile.getCollisionObj().cSpriteBox);
            missile.addSpriteToBatch(this.cSpriteBatch);
            missile.addCollisionToBatch(SpriteBatchManager.find(SpriteBatch.SpriteBatchName.Boxes));
            return(missile);
        }
Пример #8
0
 public BombRoot(GameObject.GameObjectName mGameObjectName, Sprite.SpriteName mSpriteName, int index, float mX, float mY, BombType bombType) : base(mGameObjectName, index, mSpriteName, bombType)
 {
     this.x = mX;
     this.y = mY;
     //this.delta = 4.0f;
     this.delta = Unit.bombDeltaY;
     //  this.cCollisionObj.cSpriteBox.setColor(Unit.spriteBoxColor);
 }
Пример #9
0
 public MissileRoot(GameObject.GameObjectName mGameObjectName, Sprite.SpriteName mSpriteName, int index, float mX, float mY, Missile.MissileType missileType) : base(mGameObjectName, index, mSpriteName, missileType)
 {
     this.x = mX;
     this.y = mY;
     //    this.deltaY = 10.0f;
     this.total = 0.0f;
     // this.cCollisionObj.cSpriteBox.setColor(Unit.spriteBoxColor);
 }
Пример #10
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;
 }
Пример #11
0
 public StraightMissile(GameObject.GameObjectName mGameObjectName, Sprite.SpriteName mSpriteName, int index, float mX, float mY, Missile.MissileType missileType) : base(mGameObjectName, index, mSpriteName, missileType)
 {
     this.x      = mX;
     this.y      = mY;
     this.delta  = 20.0f;
     this.launch = false;
     //   this.cCollisionObj.cSpriteBox.setColor(Unit.spriteBoxColor);
     //  hit = false;
 }
Пример #12
0
 public CannonShip(GameObject.GameObjectName mGameObjectName, Sprite.SpriteName mSpriteName, int index, float mX, float mY) : base(mGameObjectName, index, mSpriteName)
 {
     this.x = mX;
     this.y = mY;
     //  this.cCollisionObj.cSpriteBox.setColor(Unit.spriteBoxColor);
     this.delta     = Unit.shipDeltaX;
     this.shipState = null;
     // hit = false;
 }
Пример #13
0
 //private bool moveY;
 //private static screenSize;
 public AlienGrid(GameObject.GameObjectName mGameObjectName, Sprite.SpriteName mSpriteName, int index, float mX, float mY) : base(mGameObjectName, index, mSpriteName)
 {
     this.x = mX;
     this.y = mY;
     //  this.deltaX = 20.0f;
     //  this.deltaY = 40.0f;
     this.deltaX = Unit.alienDeltaX;
     this.deltaY = Unit.alienDeltaY;
     edgeHit     = false;
     //  this.cCollisionObj.cSpriteBox.setColor(Unit.spriteBoxColor);
 }
Пример #14
0
        public static GameObject find(GameObject.GameObjectName gameObjectName)
        {
            GhostManager ghostManInst = GhostManager.getSingletonInstance();

            ghostRef.cObject.cGameObjectName = gameObjectName;

            Ghost ghostNode = (Ghost)ghostManInst.genericFind(ghostRef);

            Debug.Assert(ghostNode != null);
            return(ghostNode.cObject);
        }
Пример #15
0
        public static GameObject find(GameObject.GameObjectName mGameObjectName)
        {
            GameObjectNodeManager gamMInstance = GameObjectNodeManager.getSingletonInstance();

            Debug.Assert(gamMInstance != null);

            GameObjectNode pseudoGameObjNode = cGameObjNodeRef;

            Debug.Assert(pseudoGameObjNode != null);

            pseudoGameObjNode.getGameObject().setName(mGameObjectName);

            Debug.Assert(pseudoGameObjNode != null);

            GameObjectNode targetGameObjNode = (GameObjectNode)gamMInstance.genericFind(pseudoGameObjNode);

            Debug.Assert(targetGameObjNode != null);

            return(targetGameObjNode.getGameObject());
        }
Пример #16
0
        public Alien createAlien(Alien.AlienType mAlienType, GameObject.GameObjectName gameName, int index = 0, float mX = 0.0f, float mY = 0.0f)
        {
            Alien alien = null;

            switch (mAlienType)
            {
            case Alien.AlienType.Crab:
                alien = new Crab(gameName, Sprite.SpriteName.Crab, index, mX, mY);
                break;

            case Alien.AlienType.Squid:
                alien = new Squid(gameName, Sprite.SpriteName.Squid, index, mX, mY);
                break;

            case Alien.AlienType.Octopus:
                alien = new Octopus(gameName, Sprite.SpriteName.Octopus, index, mX, mY);
                break;

            case Alien.AlienType.Column:
                alien = new Column(gameName, Sprite.SpriteName.NullObject, index, mX, mY);
                //  columnCount++;
                //  Debug.WriteLine(columnCount);
                break;

            case Alien.AlienType.AlienGrid:
                alien = new AlienGrid(gameName, Sprite.SpriteName.NullObject, index, mX, mY);
                GameObjectNodeManager.add(alien, cPCSTree);
                break;

            case Alien.AlienType.AlienExplosion:
                alien = new AlienExplode(gameName, Sprite.SpriteName.AlienExplosion, index, mX, mY);
                break;

            case Alien.AlienType.Uninitilized:
                Debug.WriteLine("Alien Type is Uninitilized");
                break;
            }

            activate(alien);
            return(alien);
        }
Пример #17
0
        public Wall createWall(Wall.WallType mWallType, GameObject.GameObjectName gameName, int index = 0, float x = 0.0f, float y = 0.0f, float width = 0.0f, float height = 0.0f)
        {
            Wall wall = null;

            switch (mWallType)
            {
            case Wall.WallType.WallTop:
                wall = new WallTop(gameName, index, Sprite.SpriteName.NullObject, x, y, width, height, Wall.WallType.WallTop);
                break;

            case Wall.WallType.WallDown:
                wall = new WallDown(gameName, index, Sprite.SpriteName.NullObject, x, y, width, height, Wall.WallType.WallDown);
                break;

            case Wall.WallType.WallLeft:
                wall = new WallLeft(gameName, index, Sprite.SpriteName.NullObject, x, y, width, height, Wall.WallType.WallLeft);
                break;

            case Wall.WallType.WallRight:
                wall = new WallRight(gameName, index, Sprite.SpriteName.NullObject, x, y, width, height, Wall.WallType.WallRight);
                break;

            case Wall.WallType.WallRoot:
                wall = new WallRoot(gameName, index, Sprite.SpriteName.NullObject, Wall.WallType.WallRoot);
                GameObjectNodeManager.add(wall, cPCSTree);
                break;

            case Wall.WallType.Uninitilized:
                Debug.WriteLine("Wall Type is Uninitilized");
                break;
            }

            this.cPCSTree.Insert(wall, this.cParent);

            wall.addSpriteToBatch(this.cSpriteBatch);
            wall.addCollisionToBatch(SpriteBatchManager.find(SpriteBatch.SpriteBatchName.Boxes));
            return(wall);
        }
Пример #18
0
        public Shield createShield(Shield.ShieldType mShieldType, GameObject.GameObjectName gameName, int index = 0, float mX = 0.0f, float mY = 0.0f)
        {
            Shield shield = null;

            switch (mShieldType)
            {
            case Shield.ShieldType.ShieldBrick:
                shield = new ShieldBrick(gameName, Sprite.SpriteName.ShieldBrick, index, mX, mY);
                break;

            case Shield.ShieldType.ShieldColumn:
                shield = new ShieldColumn(gameName, Sprite.SpriteName.NullObject, index, mX, mY);
                break;

            case Shield.ShieldType.ShieldUnit:
                shield = new ShieldUnit(gameName, Sprite.SpriteName.NullObject, index, mX, mY);
                break;

            case Shield.ShieldType.ShieldGrid:
                shield = new ShieldGrid(gameName, index, Sprite.SpriteName.NullObject);
                GameObjectNodeManager.add(shield, cPCSTree);
                break;

            case Shield.ShieldType.Uninitilized:
                Debug.WriteLine("Shield Type is Uninitilized");
                break;
            }

            this.cPCSTree.Insert(shield, this.cParent);
            // cSpriteBatch.addToBatch(shield.getProxySprite());
            // cSpriteBatch.addToBatch(shield.getCollisionObj().cSpriteBox);

            shield.addSpriteToBatch(this.cSpriteBatch);
            shield.addCollisionToBatch(SpriteBatchManager.find(SpriteBatch.SpriteBatchName.Boxes));
            return(shield);
        }
Пример #19
0
 public Octopus(GameObject.GameObjectName mGameObjectName, Sprite.SpriteName mSpriteName, int index, float mX, float mY) : base(mGameObjectName, index, mSpriteName)
 {
     this.setX(mX);
     this.setY(mY);
     //  this.cCollisionObj.cSpriteBox.setColor(Unit.spriteBoxColor);
 }
Пример #20
0
 public UFO(GameObject.GameObjectName mGameObjectName, int index, Sprite.SpriteName mSpriteName, UFO.UFOType ufoType) : base(mGameObjectName, index, mSpriteName)
 {
     this.type   = ufoType;
     this.launch = false;
 }
Пример #21
0
 public Missile(GameObject.GameObjectName mGameObjectName, int index, Sprite.SpriteName mSpriteName, Missile.MissileType missileType) : base(mGameObjectName, index, mSpriteName)
 {
     this.type = missileType;
 }
Пример #22
0
 public Bomb(GameObject.GameObjectName mGameObjectName, int index, Sprite.SpriteName mSpriteName, BombType bombType) : base(mGameObjectName, index, mSpriteName)
 {
     this.type = bombType;
 }
Пример #23
0
 public ShieldGrid(GameObject.GameObjectName mGameObjectName, int index, Sprite.SpriteName mSpriteName) : base(mGameObjectName, index, mSpriteName)
 {
     //   this.cCollisionObj.cSpriteBox.setColor(Unit.spriteBoxColor);
 }
Пример #24
0
 public Ship(GameObject.GameObjectName mGameObjectName, int index, Sprite.SpriteName mSpriteName) : base(mGameObjectName, index, mSpriteName)
 {
 }