コード例 #1
0
        public Stage(Game parent) : base(parent)
        {
            _defaultPnlType = new List <StagePnlType>
            {
                StagePnlType.Normal, StagePnlType.Ice, StagePnlType.Grass, StagePnlType.Poison, StagePnlType.Holy, StagePnlType.Hole,
                StagePnlType.Normal, StagePnlType.Ice, StagePnlType.Grass, StagePnlType.Poison, StagePnlType.Holy, StagePnlType.Hole,
                StagePnlType.Normal, StagePnlType.Ice, StagePnlType.Grass, StagePnlType.Poison, StagePnlType.Holy, StagePnlType.Hole,
            };

            _defaultPnlColr = new List <StagePnlColor>
            {
                StagePnlColor.Red, StagePnlColor.Red, StagePnlColor.Red, StagePnlColor.Blue, StagePnlColor.Blue, StagePnlColor.Blue,
                StagePnlColor.Red, StagePnlColor.Red, StagePnlColor.Red, StagePnlColor.Blue, StagePnlColor.Blue, StagePnlColor.Blue,
                StagePnlColor.Red, StagePnlColor.Red, StagePnlColor.Red, StagePnlColor.Blue, StagePnlColor.Blue, StagePnlColor.Blue,
            };

            PnlRowPnt = new List <int> {
                0, 24, 48
            };
            PnlColPnt = new List <int> {
                0, 40, 80, 120, 160, 200
            };
            BottomLeftPnt = new Point(1, 1);
            PanelArray    = new List <Panel>();

            Initialize();
        }
コード例 #2
0
        public override void Update(GameTime gameTime)
        {
            //Animate the panels if necessary
            base.Update(gameTime);

            if (ShowCust)
            {
                Lolxy  = (int)MathHelper.Clamp(Lolxy + 2, 71, 87);
                StgPos = new Point(0, Lolxy);
            }
            else
            {
                Lolxy  = (int)MathHelper.Clamp(Lolxy - 2, 71, 87);
                StgPos = new Point(0, Lolxy);
            }


            for (var i = 0; i < 3; i++)     // For each row
            {
                for (var j = 0; j < 6; j++) // For each col
                {
                    //Get the linear index of the col/row pair
                    var u = GetIndex(i, j);
                    //Designate colors accrd. to DefaultPnlColr
                    var x = _defaultPnlColr[u];
                    //Designate specific pos with offset of the StgPos
                    var y = new Point(PnlColPnt[j] + StgPos.X, PnlRowPnt[i] + StgPos.Y);
                    PanelArray[u].StgPnlPos = y;
                }
            }

            _stageRed.AdvanceAllGroups();
            _stageBlue.AdvanceAllGroups();
        }
コード例 #3
0
        public void Initialize()
        {
            StgPos     = new Point(0, 71);
            _stageRed  = new Sprite("BattleObj/Stages/Stage.sasl", "BattleObj/Stages/Red", Graphics, Content);
            _stageBlue = new Sprite("BattleObj/Stages/Stage.sasl", "BattleObj/Stages/Blue", Graphics, Content);

            for (var i = 0; i < 3; i++)
            {
                for (var j = 0; j < 6; j++)
                {
                    //Get the linear index of the col/row pair
                    var u = GetIndex(i, j);
                    //Designate colors accrd. to DefaultPnlColr
                    var x = _defaultPnlColr[u];
                    //Designate specific pos with offset of the StgPos
                    var y = new Point(PnlColPnt[j] + StgPos.X, PnlRowPnt[i] + StgPos.Y);
                    //Set panel type, could be modified on code
                    var z = _defaultPnlType[u];

                    var e = new Point(i, j);
                    var q = new Panel()
                    {
                        StgPnlClr = x,
                        StgPnlPos = y,
                        StgPnlTyp = z,
                        StgRowCol = e
                    };
                    PanelArray.Add(q);
                }
            }

            Initialized = true;
        }