Ejemplo n.º 1
0
        public void Withstand()
        {
            if (dead)
            {
                return;
            }



            //被怪的子彈攻擊到時 可做抵擋

            MISS_BOB           = new TARY_BOB(GamePage.picStar3, hero.centerLoc, 50);
            MISS_BOB.RANGE     = 80;
            MISS_BOB.v         = 60;
            MISS_BOB.CancelNum = 50;

            MISS_BOB.start();
            GamePage.effectgetPower.Play(0.5f, 0.7f, 0f);
            ProHero.start();//啟動防護機制
        }
Ejemplo n.º 2
0
        public override bool isLossHP()
        {
            if (V.imgptr == 0 || V.imgptr == 2)
            {
                return(true);
            }
            else
            {
                MISS_BOB = new TARY_BOB(GamePage.picStar6, V.centerLoc, 10);
                MISS_BOB.start();
                GamePage.effectgetPower.Play();


                if (GamePage.HERO_LV >= 10 && GamePage.R_MFired.Count() <= 72)
                {
                    this.firedM3Rn(2);
                }

                return(false);
            }
        }
Ejemplo n.º 3
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));
            }
        }
Ejemplo n.º 4
0
        public bool life()
        {
            if (Mtype)
            {
                //**一般怪**
                //判定生命是否存在~包含作標及生命值
                if (V.Y >= 830 || V.X >= 520 || V.X <= -50)
                {
                    SCORE = 0;
                    Dead  = true;
                    return(false);
                }
                else if (HP <= 0)
                {
                    //待加上 爆炸或失效果
                    ADD_X = 0;
                    ADD_Y = 0;
                    Dead  = true;   //怪已經死了


                    if (BOB == null)
                    {
                        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 = new TARY_BOB(ColorStar, V.centerLoc, (int)(V.Width / 2));
                        BOB.start();


                        Event_Dead();    //怪物死掉之後事件
                        GamePage.effectMonsterDead.Play(0.6f, 0f, 0f);


                        //將怪的分數加到看板中
                        GamePage.R_BAR.addScore(SCORE);
                    }


                    return(!BOB_END);
                }
                else
                {
                    return(true);
                }    //end if
            }
            else
            {
                //**BOSS**
                //判定生命是否存在~包含作標及生命值
                if (V.Y >= 1000)
                {
                    SCORE = 0;
                    Dead  = true;
                    return(false);
                }
                else if (HP <= 0)
                {
                    //待加上 爆炸或失效果
                    ADD_X = 0;
                    ADD_Y = 0;
                    Dead  = true;   //怪已經死了


                    if (BOB == null)
                    {
                        switch (GamePage.randObj.Next(1, 6))
                        {
                        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;
                        }

                        BOB           = new TARY_BOB(ColorStar, V.centerLoc, (int)(V.Width / 2));
                        BOB.RANGE     = 600;
                        BOB.v         = 90;
                        BOB.CancelNum = 80;
                        BOB.start();

                        Event_Dead();    //怪物死掉之後事件

                        GamePage.effectMonsterDead.Play(1f, 0f, 0f);

                        if (ClearMonster())
                        {
                            GamePage.R_LV.ClearMonster();    //BOSS死了~要求所有怪物自殺
                        }
                    }


                    return(!BOB_END);
                }
                else
                {
                    return(true);
                }
            } //end if
        }     //END