Ejemplo n.º 1
0
        public void firedF5()
        {
            //怪物開火 - 直線
            ball_M1 ballX1 = new ball_M1(this.V.centerLoc);

            GamePage.R_MFired.Add(ballX1);


            ball_M1 ballX2 = new ball_M1(this.V.centerLoc);

            ballX2.ADD_X -= 0.5f;
            GamePage.R_MFired.Add(ballX2);


            ball_M1 ballX3 = new ball_M1(this.V.centerLoc);

            ballX3.ADD_X += 0.5f;
            GamePage.R_MFired.Add(ballX3);



            ball_M1 ballX4 = new ball_M1(this.V.centerLoc);

            ballX4.ADD_X += 1.2f;
            GamePage.R_MFired.Add(ballX4);



            ball_M1 ballX5 = new ball_M1(this.V.centerLoc);

            ballX5.ADD_X -= 1.2f;
            GamePage.R_MFired.Add(ballX5);
        }
Ejemplo n.º 2
0
        public void firedX()
        {
            //怪物開火 - 對準英雄開火
            ball_M1 ballX = new ball_M1(this.V.centerLoc);

            ballX.ADD_X = (GamePage.R_HERO.centerLoc.X - this.V.centerLoc.X) / ((GamePage.R_HERO.centerLoc.Y - this.V.centerLoc.Y) / 2);
            GamePage.R_MFired.Add(ballX);
        }
Ejemplo n.º 3
0
        public void firedF3()
        {
            ball_M1 ballX1 = new ball_M1(this.V.centerLoc);

            GamePage.R_MFired.Add(ballX1);


            ball_M1 ballX2 = new ball_M1(this.V.centerLoc);

            ballX2.ADD_X -= 0.5f;
            GamePage.R_MFired.Add(ballX2);



            ball_M1 ballX3 = new ball_M1(this.V.centerLoc);

            ballX3.ADD_X += 0.5f;
            GamePage.R_MFired.Add(ballX3);
        }
Ejemplo n.º 4
0
        public void firedRn(int n)
        {
            //怪物爆炸 - 隨機朝著四面八方

            for (int i = 0; i < n; i++)
            {
                int     p      = GamePage.randObj.Next(0, 5);
                ball_M1 ballX1 = new ball_M1(this.V.centerLoc);



                if (p == 0 || p == 1)
                {
                    ballX1.ADD_Y = -3.5f;
                    ballX1.ADD_X = GamePage.randObj.Next(-30, 30) * 0.1f;
                }
                else if (p == 2 || p == 3)
                {
                    ballX1.ADD_Y = 3.5f;
                    ballX1.ADD_X = GamePage.randObj.Next(-30, 30) * 0.1f;
                }
                else
                {
                    if (GamePage.randObj.Next(0, 2) == 0)
                    {
                        ballX1.ADD_X = GamePage.randObj.Next(30, 35) * 0.1f;
                    }
                    else
                    {
                        ballX1.ADD_X = GamePage.randObj.Next(30, 35) * -0.1f;
                    }

                    ballX1.ADD_Y = 0;
                }

                GamePage.R_MFired.Add(ballX1);
            }//for
        }