Beispiel #1
0
//		private Sound m_sndStep1;
//		private Sound m_sndStep2;

        public InvadersGrid()
        {
            this.SourceRect = new ERectangle(0, 0, 1, 1);

            this._invaders = new List <Invader>();

            int nColumns = 11;
            int nRows    = 5;

            //nColumns = 0;
            //nRows = 0;

            this._columnSortedInvaders = new SortedList <int, SortedList <int, Invader> >();
            for (int i = 0; i < nColumns; i++)
            {
                this._columnSortedInvaders.Add(i, new SortedList <int, Invader>());
            }

            for (int y = 0; y < nRows; y++)
            {
                string anim = "Invader03";
                if (y >= 3)
                {
                    anim = "Invader01";
                }
                else if (y >= 1)
                {
                    anim = "Invader02";
                }

                for (int x = 0; x < nColumns; x++)
                {
                    Invader invader = new Invader();
                    invader.SetGraphics(anim);
                    invader.Loc    = new EPointF((x - 1) * 32, (y - 1) * 32) + new EPointF(185, 124);
                    invader.Parent = this;

                    this._invaders.Add(invader);
                    this._columnSortedInvaders[x].Add(y, invader);
                }
            }

            this.m_pntMovement = new EPointF(4, 0);
        }
Beispiel #2
0
        //        private Sound m_sndStep1;
        //        private Sound m_sndStep2;
        public InvadersGrid()
        {
            this.SourceRect = new ERectangle(0,0,1,1);

            this._invaders = new List<Invader>();

            int nColumns = 11;
            int nRows = 5;

            //nColumns = 0;
            //nRows = 0;

            this._columnSortedInvaders = new SortedList<int, SortedList<int, Invader>>();
            for (int i = 0; i < nColumns; i++)
                this._columnSortedInvaders.Add(i, new SortedList<int, Invader>());

            for (int y = 0; y < nRows; y++)
            {
                string anim = "Invader03";
                if (y >= 3)
                    anim = "Invader01";
                else if (y>=1)
                    anim = "Invader02";

                for (int x = 0; x<nColumns; x++)
                {
                    Invader invader = new Invader();
                    invader.SetGraphics(anim);
                    invader.Loc = new EPointF((x-1)*32,(y-1)*32) + new EPointF(185,124);
                    invader.Parent = this;

                    this._invaders.Add(invader);
                    this._columnSortedInvaders[x].Add(y, invader);
                }
            }

            this.m_pntMovement = new EPointF(4,0);
        }