Пример #1
0
        public void Draw(SpriteBatch P)
        {
            LeftFire.draw(P);
            RightFire.draw(P);
            SCORE.draw(P);

            for (int i = 0; i < StarBar.Length; i++)
            {
                StarBar[i].draw(P);
            }
        }
Пример #2
0
        public void update()
        {
            for (int i = 0; i < GamePage.touchState.Count; i++)
            {
                GamePage.touchLocation = GamePage.touchState[i];



                if (GamePage.touchState[i].State == TouchLocationState.Released)
                {
                    LeftFire.imgptr  = 0;
                    RightFire.imgptr = 0;
                }


                //******************
                if (GamePage.R_LV.T_ScoreChgMoney)
                {
                    if (GamePage.touchState[i].State == TouchLocationState.Pressed)
                    {
                        if (LeftFire.touchXY(GamePage.touchLocation.Position.X, GamePage.touchLocation.Position.Y))
                        {
                            //執行跳過 分數計算
                            GamePage.R_LV.ScoreChgMoney.auto();
                            LeftFire.imgptr  = 1;
                            RightFire.imgptr = 0;
                        }
                        else if (RightFire.touchXY(GamePage.touchLocation.Position.X, GamePage.touchLocation.Position.Y))
                        {
                            GamePage.R_LV.ScoreChgMoney.auto();
                            LeftFire.imgptr  = 0;
                            RightFire.imgptr = 1;
                        }
                    }

                    return;//若是過關就不發射攻擊
                }
                //******************



                if (GamePage.touchState[i].State == TouchLocationState.Moved)
                {
                    // Debug.WriteLine("  X:"+GamePage.touchLocation.Position.X.ToString() + "  Y:" + GamePage.touchLocation.Position.Y);


                    if (TempMove2 > TempMove - TempMoveLv)
                    {
                        TempMove2 = 0;



                        if (LeftFire.touchXY(GamePage.touchLocation.Position.X, GamePage.touchLocation.Position.Y))
                        {
                            GamePage.R_HERO.Mainfire(power[(powerLv * 2)]);
                            LeftFire.imgptr = 1;
                            //RightFire.imgptr = 0;

                            for (int j = i; j < GamePage.touchState.Count; j++)
                            {
                                GamePage.touchLocation = GamePage.touchState[j];
                                if (RightFire.touchXY(GamePage.touchLocation.Position.X, GamePage.touchLocation.Position.Y))
                                {
                                    GamePage.R_HERO.Secondfire(power[(powerLv * 2) + 1]);
                                    //LeftFire.imgptr = 0;
                                    RightFire.imgptr = 1;
                                    break;
                                }
                            }
                            return;
                        }



                        if (RightFire.touchXY(GamePage.touchLocation.Position.X, GamePage.touchLocation.Position.Y))
                        {
                            GamePage.R_HERO.Secondfire(power[(powerLv * 2) + 1]);
                            //LeftFire.imgptr = 0;
                            RightFire.imgptr = 1;
                            for (int j = i; j < GamePage.touchState.Count; j++)
                            {
                                GamePage.touchLocation = GamePage.touchState[j];
                                if (LeftFire.touchXY(GamePage.touchLocation.Position.X, GamePage.touchLocation.Position.Y))
                                {
                                    GamePage.R_HERO.Mainfire(power[(powerLv * 2)]);
                                    LeftFire.imgptr = 1;
                                    //RightFire.imgptr = 0;
                                    break;
                                }
                            }
                            return;
                        }
                    }
                    else
                    {
                        TempMove2++;
                    }
                    return;
                }
            }
        }