public Super CreateSuper()
        {
            Super temp = ((Super)(Find(GameObjName.Super)));

            if (temp != null)
            {
                ((Super)(Find(GameObjName.Super))).Purge();
            }

            ColObj _colobj = new ColObj(Rectangle.Empty, ColObjName.Super, SpriteName.BBox);

            ColObjManager.getInstance().Add(_colobj);
            Super Obj;

            if (temp != null)
            {
                Obj          = temp;
                Obj.BombPool = temp.BombPool;
            }
            else
            {
                Obj          = new Super(GameObjName.Super, _colobj, new Vector2(0, 0));
                Obj.BombPool = new BombReserve();

                ColGroup Invaders = ColGroupManager.getInstance().find(ColGroupName.Alien);
                Invaders.Add(Obj);

                GameObjMananger.getInstance().Add(Obj);
            }

            Obj.Create();


            return(Obj);
        }
Example #2
0
        public ColGroup Create()
        {
            ColGroup inColGroup = new ColGroup(ColGroupName.Missile);

            this.Add(inColGroup);

            inColGroup = new ColGroup(ColGroupName.Alien);
            this.Add(inColGroup);

            inColGroup = new ColGroup(ColGroupName.Wall);
            this.Add(inColGroup);

            inColGroup = new ColGroup(ColGroupName.Shield);
            this.Add(inColGroup);

            inColGroup = new ColGroup(ColGroupName.Ship);
            this.Add(inColGroup);

            inColGroup = new ColGroup(ColGroupName.Bomb);
            this.Add(inColGroup);

            inColGroup = new ColGroup(ColGroupName.Ufo);
            this.Add(inColGroup);

            return(inColGroup);
        }
Example #3
0
        public void ReplaceColGroup(ColGroup inColGroup)
        {
            if (inColGroup.Equals(CollidingGroupA))
            {
                CollidingGroupA = inColGroup;
            }

            if (inColGroup.Equals(CollidingGroupB))
            {
                CollidingGroupB = inColGroup;
            }
        }
Example #4
0
        public ColGroup find(ColGroupName inName)
        {
            int index = 0;

            ColGroup Obj = (ColGroup)ColGroups.getDatabyIndex(index);

            while (Obj != null)
            {
                if (Obj.Name.Equals(inName))
                {
                    return(Obj);
                }

                index++;
                Obj = (ColGroup)ColGroups.getDatabyIndex(index);
            }

            return(null);
        }
Example #5
0
        public ColPair Find(ColGroup inObj)
        {
            int index = 0;

            ColPair Obj = (ColPair)List.getDatabyIndex(index);

            while (Obj != null)
            {
                if (Obj.getColGroupA().Equals(inObj) || Obj.getColGroupB().Equals(inObj))
                {
                    return(Obj);
                }

                index++;
                Obj = (ColPair)List.getDatabyIndex(index);
            }

            return(null);
        }
        public UFO CreateUfo()
        {
            Rectangle inRect = new Rectangle(-70, 120, 95 / 2, 46 / 2);

            TextureSprite Text    = new TextureSprite(inRect, new Vector2(1, 1), 0.0f, 1.0f, SpriteName.Ufo);
            ColObj        _colobj = new ColObj(inRect, ColObjName.UFO, SpriteName.BBox);

            ColObjManager.getInstance().Add(_colobj);
            UFO Obj = new UFO(GameObjName.UFO, _colobj, new Vector2(inRect.X, inRect.Y), Text, 100);

            SpriteBatchManager.getInstance().Find(SpriteBatchName.Scene).Add(Text);

            ColGroup Invaders = ColGroupManager.getInstance().find(ColGroupName.Ufo);

            Invaders.Add(Obj);

            GameObjMananger.getInstance().Add(Obj);

            return(Obj);
        }
        public void KillObject(GameObj inObj, SpriteBatchName inSpName)
        {
            GameSprite _gameSprite = inObj.getGameSprite();

            if (_gameSprite != null)
            {
                SpriteBatchManager.getInstance().Kill(_gameSprite, inSpName);
            }

            ColObj _colObj = inObj.getColObj();

            if (_colObj != null)
            {
                ColObjManager.getInstance().Kill(_colObj);
            }

            ColGroup _ColGroup = ColGroupManager.getInstance().find(inObj.TempColGroupName);

            _ColGroup.Kill(inObj);

            Kill(inObj);
        }
        public Bomb CreateBomb(Rectangle inRect)
        {
            TextureSprite Text    = new TextureSprite(inRect, new Vector2(1, 1), 0.0f, 1.0f, SpriteName.Bomb);
            ColObj        _colobj = new ColObj(inRect, ColObjName.Missile, SpriteName.BBox);
            Bomb          Obj     = new Bomb(GameObjName.Missile, _colobj, new Vector2(inRect.X, inRect.Y), Text, ColGroupName.Bomb);

            ColGroup X = ColGroupManager.getInstance().find(Obj.TempColGroupName);

            if (X == null)
            {
                ColGroupManager.getInstance().find(ColGroupName.Bomb);
            }

            ColObjManager.getInstance().Add(_colobj);
            SpriteBatchManager.getInstance().Find(SpriteBatchName.Scene).Add(Text);

            ColGroupManager.getInstance().find(Obj.TempColGroupName).Add(Obj);

            GameObjMananger.getInstance().Add(Obj);

            return(Obj);
        }
        public Missile CreateMissile(Rectangle inRect)
        {
            TextureSprite Text    = new TextureSprite(inRect, new Vector2(1, 1), 0.0f, 1.0f, SpriteName.Missile);
            ColObj        _colobj = new ColObj(inRect, ColObjName.Missile, SpriteName.BBox);
            Missile       Obj     = new Missile(GameObjName.Missile, _colobj, new Vector2(inRect.X, inRect.Y), Text, ColGroupName.Missile);

            ColGroup X = ColGroupManager.getInstance().find(Obj.TempColGroupName);

            if (X == null)
            {
                ColGroupManager.getInstance().find(ColGroupName.Missile);
            }

            ColObjManager.getInstance().Add(_colobj);
            SpriteBatchManager.getInstance().Find(SpriteBatchName.Scene).Add(Text);

            ColGroupManager.getInstance().find(Obj.TempColGroupName).Add(Obj);

            GameObjMananger.getInstance().Add(Obj);
            Obj.setStatus(false);
            ((Ship)(GameObjMananger.getInstance().Find(GameObjName.Ship))).setMissile(Obj);

            return(Obj);
        }
        public Wall CreateLevel(GraphicsDevice Graph)
        {
            //////////////////////////////////////////Walls
            ColGroup Walls = ColGroupManager.getInstance().find(ColGroupName.Wall);

            //Left Wall
            ColObj _colobj = new ColObj(new Rectangle(15, 100, 5, Graph.Viewport.Height - 145), ColObjName.Wall, SpriteName.BBox);
            Wall   Obj     = new Wall(GameObjName.Wall, _colobj, new Vector2(15, 100));

            ColObjManager.getInstance().Add(_colobj);
            ColGroupManager.getInstance().find(ColGroupName.Wall).Add(Obj);
            GameObjMananger.getInstance().Add(Obj);

            //Right Wall
            _colobj = new ColObj(new Rectangle(Graph.Viewport.Width - 15, 100, 5, Graph.Viewport.Height - 145), ColObjName.Wall, SpriteName.BBox);
            Obj     = new Wall(GameObjName.Wall, _colobj, new Vector2(Graph.Viewport.Width - 15, 100));
            ColObjManager.getInstance().Add(_colobj);
            ColGroupManager.getInstance().find(ColGroupName.Wall).Add(Obj);
            GameObjMananger.getInstance().Add(Obj);

            //Top Wall
            _colobj = new ColObj(new Rectangle(15, 100, Graph.Viewport.Width - 25, 5), ColObjName.Wall, SpriteName.BBox);
            Obj     = new Wall(GameObjName.Wall, _colobj, new Vector2(15, 100));
            ColObjManager.getInstance().Add(_colobj);
            ColGroupManager.getInstance().find(ColGroupName.Wall).Add(Obj);
            GameObjMananger.getInstance().Add(Obj);

            //Bottom Wall
            _colobj = new ColObj(new Rectangle(15, Graph.Viewport.Height - 50, Graph.Viewport.Width - 25, 5), ColObjName.Wall, SpriteName.BBox);
            Obj     = new Wall(GameObjName.Wall, _colobj, new Vector2(15, Graph.Viewport.Height - 50));
            ColObjManager.getInstance().Add(_colobj);
            ColGroupManager.getInstance().find(ColGroupName.Wall).Add(Obj);
            GameObjMananger.getInstance().Add(Obj);

            return(Obj);
        }
        public Shield CreateShield()
        {
            ColGroup  Shields = ColGroupManager.getInstance().find(ColGroupName.Shield);
            Rectangle inRect  = new Rectangle(150, 600, 100, 100);
            Rectangle inRectparts;

            //Shield 1
            TextureSprite Text    = new TextureSprite(inRect, new Vector2(1, 1), 0.0f, 1.0f, SpriteName.Shield);
            ColObj        _colobj = new ColObj(inRect, ColObjName.Shield, SpriteName.BBox);
            Shield        Obj     = new Shield(GameObjName.Shield, _colobj, new Vector2(inRect.X, inRect.Y), Text, ColGroupName.Shield);

            ColObjManager.getInstance().Add(_colobj);
            // SpriteBatchManager.getInstance().Find(SpriteBatchName.Scene).Add(Text);
            ColGroupManager.getInstance().find(ColGroupName.Shield).Add(Obj);

            inRectparts = new Rectangle(inRect.X, inRect.Y, 10, 10);
            Obj.Create(inRectparts);

            GameObjMananger.getInstance().Add(Obj);


            inRect = new Rectangle(350, 600, 100, 100);
            //Shield 2
            Text    = new TextureSprite(inRect, new Vector2(1, 1), 0.0f, 1.0f, SpriteName.Shield);
            _colobj = new ColObj(inRect, ColObjName.Shield, SpriteName.BBox);
            Obj     = new Shield(GameObjName.Shield, _colobj, new Vector2(inRect.X, inRect.Y), Text, ColGroupName.Shield);
            ColObjManager.getInstance().Add(_colobj);
            // SpriteBatchManager.getInstance().Find(SpriteBatchName.Scene).Add(Text);
            ColGroupManager.getInstance().find(ColGroupName.Shield).Add(Obj);

            inRectparts = new Rectangle(inRect.X, inRect.Y, 10, 10);
            Obj.Create(inRectparts);

            GameObjMananger.getInstance().Add(Obj);

            inRect = new Rectangle(550, 600, 100, 100);
            //Shield 3
            Text    = new TextureSprite(inRect, new Vector2(1, 1), 0.0f, 1.0f, SpriteName.Shield);
            _colobj = new ColObj(inRect, ColObjName.Shield, SpriteName.BBox);
            Obj     = new Shield(GameObjName.Shield, _colobj, new Vector2(inRect.X, inRect.Y), Text, ColGroupName.Shield);
            ColObjManager.getInstance().Add(_colobj);
            ColGroupManager.getInstance().find(ColGroupName.Shield).Add(Obj);

            inRectparts = new Rectangle(inRect.X, inRect.Y, 10, 10);
            Obj.Create(inRectparts);

            GameObjMananger.getInstance().Add(Obj);

            inRect = new Rectangle(750, 600, 100, 100);
            //Shield 4
            Text    = new TextureSprite(inRect, new Vector2(1, 1), 0.0f, 1.0f, SpriteName.Shield);
            _colobj = new ColObj(inRect, ColObjName.Shield, SpriteName.BBox);
            Obj     = new Shield(GameObjName.Shield, _colobj, new Vector2(inRect.X, inRect.Y), Text, ColGroupName.Shield);
            ColObjManager.getInstance().Add(_colobj);
            ColGroupManager.getInstance().find(ColGroupName.Shield).Add(Obj);

            inRectparts = new Rectangle(inRect.X, inRect.Y, 10, 10);
            Obj.Create(inRectparts);

            GameObjMananger.getInstance().Add(Obj);

            return(Obj);
        }
Example #12
0
 public ColPair(ColGroup inColGrpA, ColGroup inColGrpB)
 {
     CollidingGroupA = inColGrpA;
     CollidingGroupB = inColGrpB;
 }