コード例 #1
0
        GameObjectTree makeGameObjectTree()
        {
            SpriteManager  m = SpriteManagerFactory.createSpriteManager(SpriteType.Alien, 0);
            GameObjectTree g = new GameObjectTree();
            Scale          a = SizeFactory.getFactory.alienScale;

            for (int i = 0; i < 2; i++)
            {
                for (int j = 0; j < 11; j++)
                {
                    GameObject temp = GameObjectFactory.createGameObject();
                    Sprite     s    = ProxySpriteFactory.makeProxySprite(SpriteType.Crab);
                    m.createActive(s);
                    temp.setSprite(s);
                    temp.setCollisionSprite(ProxySpriteCollisionFactory.proxy);
                    temp.setScale(a.spriteWidth, a.spriteHeight);
                    temp.setColScale(a.colWidth, a.colHeight);
                    Alien t = new Alien(temp, ScoreReferenceFactory.getFactory.getScore(SpriteType.Crab));
                    PlayerModeStatusManagerFactory.getFactory.addObject(t);
                    g.AddToActive(j, i, t);
                }
            }
            for (int i = 2; i < 4; i++)
            {
                for (int j = 0; j < 11; j++)
                {
                    GameObject temp = GameObjectFactory.createGameObject();
                    Sprite     s    = ProxySpriteFactory.makeProxySprite(SpriteType.Bug);
                    m.createActive(s);
                    temp.setSprite(s);
                    temp.setCollisionSprite(ProxySpriteCollisionFactory.proxy);
                    temp.setScale(a.spriteWidth, a.spriteHeight);
                    temp.setColScale(a.colWidth, a.colHeight);
                    Alien t = new Alien(temp, ScoreReferenceFactory.getFactory.getScore(SpriteType.Bug));
                    PlayerModeStatusManagerFactory.getFactory.addObject(t);
                    g.AddToActive(j, i, t);
                }
            }
            for (int i = 4; i < 5; i++)
            {
                for (int j = 0; j < 11; j++)
                {
                    GameObject temp = GameObjectFactory.createGameObject();
                    Sprite     s    = ProxySpriteFactory.makeProxySprite(SpriteType.Squid);
                    m.createActive(s);
                    temp.setSprite(s);
                    temp.setCollisionSprite(ProxySpriteCollisionFactory.proxy);
                    temp.setScale(a.spriteWidth, a.spriteHeight);
                    temp.setColScale(a.colWidth, a.colHeight);
                    Alien t = new Alien(temp, ScoreReferenceFactory.getFactory.getScore(SpriteType.Squid));
                    PlayerModeStatusManagerFactory.getFactory.addObject(t);
                    g.AddToActive(j, i, t);
                }
            }
            return(g);
        }
コード例 #2
0
 public virtual void AddToActive(int column, int row, ObjectController gameObject)
 {
     total++;
     if (activeColumns == null)
     {
         activeColumns = new GameObjectColumn(column);
         activeColumns.AddToActive(column, row, gameObject);
     }
     else
     {
         GameObjectTree columnTemp = activeColumns;
         while (columnTemp.nextNode != null && columnTemp.getNum() != column)
         {
             columnTemp = columnTemp.nextNode;
         }
         if (columnTemp.getNum() != column)
         {
             columnTemp.nextNode = new GameObjectColumn(column);
             columnTemp          = columnTemp.nextNode;
         }
         columnTemp.AddToActive(column, row, gameObject);
     }
 }
コード例 #3
0
        public GameObjectTree makeGameObjectTreeShield()
        {
            SpriteManager  m = SpriteManagerFactory.createSpriteManager(SpriteType.Shield, 0);
            GameObjectTree g = new GameObjectTree();
            Scale          a = SizeFactory.getFactory.shieldScale;

            for (int i = 3; i < 11; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    GameObject temp = GameObjectFactory.createGameObject();
                    Sprite     s    = ProxySpriteFactory.makeProxySprite(SpriteType.Shield);
                    m.createActive(s);
                    temp.setSprite(s);
                    temp.setCollisionSprite(ProxySpriteCollisionFactory.proxy);
                    temp.setScale(a.spriteWidth, a.spriteHeight);
                    temp.setColScale(a.colWidth, a.colHeight);
                    Shield t = new Shield(temp);
                    PlayerModeStatusManagerFactory.getFactory.addObject(t);
                    g.AddToActive(j, i, t);
                }
            }

            for (int j = 0; j < 3; j++)
            {
                GameObject temp = GameObjectFactory.createGameObject();
                Sprite     s    = ProxySpriteFactory.makeProxySprite(SpriteType.Shield);
                m.createActive(s);
                temp.setSprite(s);
                temp.setCollisionSprite(ProxySpriteCollisionFactory.proxy);
                temp.setScale(a.spriteWidth, a.spriteHeight);
                temp.setColScale(a.colWidth, a.colHeight);
                Shield t = new Shield(temp);
                PlayerModeStatusManagerFactory.getFactory.addObject(t);
                g.AddToActive(j, 2, t);
            }
            for (int j = 5; j < 8; j++)
            {
                GameObject temp = GameObjectFactory.createGameObject();
                Sprite     s    = ProxySpriteFactory.makeProxySprite(SpriteType.Shield);
                m.createActive(s);
                temp.setSprite(s);
                temp.setCollisionSprite(ProxySpriteCollisionFactory.proxy);
                temp.setScale(a.spriteWidth, a.spriteHeight);
                temp.setColScale(a.colWidth, a.colHeight);
                Shield t = new Shield(temp);
                PlayerModeStatusManagerFactory.getFactory.addObject(t);
                g.AddToActive(j, 2, t);
            }

            for (int i = 0; i < 2; i++)
            {
                for (int j = 0; j < 2; j++)
                {
                    GameObject temp = GameObjectFactory.createGameObject();
                    Sprite     s    = ProxySpriteFactory.makeProxySprite(SpriteType.Shield);
                    m.createActive(s);
                    temp.setSprite(s);
                    temp.setCollisionSprite(ProxySpriteCollisionFactory.proxy);
                    temp.setScale(a.spriteWidth, a.spriteHeight);
                    temp.setColScale(a.colWidth, a.colHeight);
                    Shield t = new Shield(temp);
                    PlayerModeStatusManagerFactory.getFactory.addObject(t);
                    g.AddToActive(j, i, t);
                }
                for (int j = 6; j < 8; j++)
                {
                    GameObject temp = GameObjectFactory.createGameObject();
                    Sprite     s    = ProxySpriteFactory.makeProxySprite(SpriteType.Shield);
                    m.createActive(s);
                    temp.setSprite(s);
                    temp.setCollisionSprite(ProxySpriteCollisionFactory.proxy);
                    temp.setScale(a.spriteWidth, a.spriteHeight);
                    temp.setColScale(a.colWidth, a.colHeight);
                    Shield t = new Shield(temp);
                    PlayerModeStatusManagerFactory.getFactory.addObject(t);
                    g.AddToActive(j, i, t);
                }
            }
            return(g);
        }