示例#1
0
        public override void update()
        {
            V.Rotation += 0.05f;

            //凸然出現的怪獸  出現後 鎖定英雄身捨攻擊

            BOB_update();

            //第一階段*****保護怪獸 並且閃閃怪獸
            if (n >= 0)
            {
                n--;
                if (n % 2 == 1)
                {
                    V.Alpha = 0f;
                }
                else
                {
                    V.Alpha = 1000f;
                }
                return;
            }


            //第二階段*****停止並計算英雄目標,"準備"開始衝刺
            if (Timer == null)
            {
                Timer        = new TARY_TIMER(0, sec);
                targetLoc    = GamePage.R_HERO.centerLoc;
                targetLoc.X -= V.Width / 2;
                targetLoc.X += randObj.Next(-100, 100);
                targetLoc.Y  = 850;

                Timer.start();
                V.imgptr++;
            }


            if (Timer.getT)
            {
                Timer.UPDATE();
                return;
            }



            //第三階段*****開始衝刺
            X += (targetLoc.X - X) / 16;
            Y += (targetLoc.Y - Y) / 16;
        }
示例#2
0
        public void setF(int num)
        {
            //設定英雄移動速度
            if (num >= 16)
            {
                F = 16;
            }
            else
            {
                F = num;
            }

            ProHero = new TARY_TIMER(0, 30 + num * 2);//延長被保護的效果
        }
示例#3
0
        public override void update()
        {
            V.Rotation += 0.05f;
            //追蹤鎖定英雄的怪物 若怪被擊中就觸發鎖定事件

            BOB_update();

            //第一階段*****前進觸發範圍
            if (Y <= n)
            {
                Y += ADD_Y;
                return;
            }


            //第二階段*****停止並計算英雄目標,"準備"開始衝刺
            if (Timer == null)
            {
                Timer        = new TARY_TIMER(0, sec);
                targetLoc    = GamePage.R_HERO.centerLoc;
                targetLoc.X -= V.Width / 2;
                targetLoc.X += randObj.Next(-100, 100);
                targetLoc.Y  = 850;

                Timer.start();

                V.imgptr++;//怪物變色
            }
            if (Timer.getT)
            {
                Timer.UPDATE();
                return;
            }



            //第三階段*****開始衝刺
            X += (targetLoc.X - X) / 16;
            Y += (targetLoc.Y - Y) / 16;
        }
示例#4
0
        public GAME_END()
        {
            Time = new TARY_TIMER(1, 350);
            Time.start();


            GAMEEND        = new TARY_VIMG(GamePage.picGAMEEND, new Vector2(15, 140));
            GAMEEND.Size   = 2;
            GAMESCORE      = new TARY_VIMG(GamePage.picSCORE, new Vector2(60, 300));
            GAMESCORE.Size = 2;
            SCORE          = new TARY_SCORE(GamePage.picNum, new Vector2(150, 300));
            SCORE.Score    = GamePage.HERO_SCORE;
            SCORE.Size     = 2;
            SCORE.ScoreV   = 7;


            for (int i = 0; i < bob.Count(); i++)
            {
                switch (GamePage.randObj.Next(1, 8))
                {
                case 1: ColorStar = GamePage.picStar7; break;                //白色為6   star1為背景色

                case 2: ColorStar = GamePage.picStar2; break;

                case 3: ColorStar = GamePage.picStar3; break;

                case 4: ColorStar = GamePage.picStar4; break;

                case 5: ColorStar = GamePage.picStar5; break;

                case 6: ColorStar = GamePage.picStar6; break;

                case 7: ColorStar = GamePage.picStar8; break;
                }

                bob[i] = new TARY_BOB(ColorStar, new Vector2(GamePage.randObj.Next(10, 470), GamePage.randObj.Next(10, 750)), GamePage.randObj.Next(15, 80));
            }
        }
示例#5
0
        public override void update()
        {
            V.Rotation += 0.05f;

            //亂槍射擊的怪物 若怪被擊中就觸發亂鎖定發射

            BOB_update();

            //第一階段*****前進觸發範圍
            if (Y <= n)
            {
                Y += ADD_Y;
                return;
            }


            //第二階段*****停止並計算英雄目標,"準備"開始衝刺
            if (Timer == null)
            {
                Timer       = new TARY_TIMER(0, sec);
                targetLoc.X = randObj.Next(-20, 480);
                targetLoc.Y = 850;

                Timer.start();
                V.imgptr++;
            }
            if (Timer.getT)
            {
                Timer.UPDATE();
                return;
            }



            //第三階段*****開始衝刺
            X += (targetLoc.X - X) / 16;
            Y += (targetLoc.Y - Y) / 16;
        }
示例#6
0
        int GP = 0;//若是重生 將編制 第幾群組

        public MENU_DEAD(int gp)
        {
            GamePage.HERO_LIFE--;
            GP          = gp;
            HERO        = new TARY_VIMG(GamePage.picHERO, new Vector2(180, 280));
            LIFE        = new TARY_SCORE(GamePage.picNum, new Vector2(240, 280));
            LIFE.Prefix = "× ";
            LIFE.Score  = GamePage.HERO_LIFE;


            GAMEOVER = new TARY_VIMG(GamePage.picGAMEOVER, new Vector2(90, 150));

            GAMESCORE      = new TARY_VIMG(GamePage.picSCORE, new Vector2(40, 400));
            GAMESCORE.Size = 2;

            SCORE        = new TARY_SCORE(GamePage.picNum, new Vector2(200, 400));
            SCORE.Score  = GamePage.HERO_SCORE;
            SCORE.Size   = 2;
            SCORE.ScoreV = 7;

            Time = new TARY_TIMER(1, 200);
            Time.start();
        }