Пример #1
0
        public Level02()
        {
            music      = new Music();
            countTime  = new CountTime();
            turn       = new TurnPage();
            randomizer = new Random();

            background    = new AnimateActor("sunsetBk", 1, new Point(697, 330), 1.5f);
            holegrass     = new AnimateActor("holegrass", 1, new Point(247, 360), 1.1f);
            mainCharactor = new MainCharactor("DragonFire1", 2, new Point(120, 550), 4.5f);
            blackDragon   = new BlackDragon("blackdragon", 2, new Point(970, 550), 4.5f);
            redfire       = new Fire("redfire", 3, new Point(385, 465), 1.8f, 0.5f, 1);
            bluefire      = new Fire("BlueFire", 3, new Point(740, 465), 1.8f, 0.5f, 1);
            clouds        = new ContinuousActor("sunsetCloud", 4, new Point(100, 0), 1.7f, 400, 30, 5);

            douwn     = false;
            downCount = 0;

            //------說明頁
            if (Global.Mode > 0)
            {
                explain  = new AnimateActor("Level02explain0", 3, new Point(550, 410), 2);
                rNextBtn = new AnimateActor("graExpRBtn0", 1, new Point(1000, 450), 1.3f);
            }
            else
            {
                explain  = new AnimateActor("story22", 1, new Point(550, 410), 2);
                rNextBtn = new AnimateActor("Rnext", 1, new Point(1000, 450), 1.3f);
            }
            ExplainPlayBtn = new AnimateActor("exPlay", 1, new Point(550, 630), 1);

            lNextBtn = new AnimateActor("graExpLBtn0", 1, new Point(100, 450), 1.3f);

            Global.target = 1;
        }
Пример #2
0
        //-------------建構子-------------//
        public Level01()
        {
            music      = new Music();
            countTime  = new CountTime();
            turn       = new TurnPage();
            yellowBird = new YellowBird("YellowBird", 3, new Point(1100, 100), 6);
            Background = new Actor("pink", new Point(690, 300), 1.2f);
            RainBow    = new Actor("rainbow", new Point(550, 640), 1.2f);
            Cloud      = new AnimateActor("clouds", 1, new Point(550, 430), 2);
            WingL      = new AnimateActor("wing0", 2, new Point(570, 470), 1.7f);
            WingR      = new AnimateActor("wing1", 2, new Point(540, 365), 1.2f);

            mainCharactor = new MainCharactor("dragon", 3, new Point(690, 220), 8);
            stone         = new AnimateActor("stone", 1, new Point(1100, 200), 5f);

            //------說明頁
            if (Global.Mode > 0)
            {
                explain  = new AnimateActor("Level01explain0", 1, new Point(550, 410), 2);
                rNextBtn = new AnimateActor("Rnext", 1, new Point(1000, 430), 1.3f);
            }
            else
            {
                explain  = new AnimateActor("story15", 1, new Point(550, 410), 2);
                rNextBtn = new AnimateActor("graExpRBtn0", 1, new Point(1000, 430), 1.3f);
            }
            ExplainPlayBtn = new AnimateActor("exPlay", 1, new Point(550, 630), 1);

            lNextBtn = new AnimateActor("graExpLBtn0", 1, new Point(100, 430), 1.3f);

            Global.target = 2;
        }
Пример #3
0
        public Stage03()
        {
            music     = new Music("stage03.mp3");
            turn      = new TurnPage();
            countTime = new CountTime();

            river  = new AnimateActor("river", 14, new Point(560, 550), 2.3f);
            river2 = new AnimateActor("river", 14, new Point(560, 550), 2.3f);

            background = new ContinuousActor("GridWall", 4, new Point(100, 340), 1f, 880, 100, 0);
            grid       = new ContinuousActor("grid", 4, new Point(195, 700), 2, 500, 100, 0);
            winroad    = new AnimateActor("finish", 1, new Point(1820, 530), 1.8f); //520到底

            mainCharacter = new MainCharactor("dragon", 3, new Point(420, 430), 8); // size 6
            pinkDragon    = new PinkDragon("Pinkdragon", 3, new Point(1990, 550), 6);
            yellowDragon  = new YellowDragon[yellow_NUM];
            healthPts     = new HealthPt[yellow_NUM];

            for (int i = 0; i < yellow_NUM; i++)
            {
                yellowDragon[i] = new YellowDragon("yellowdragon", 2, new Point(555, 600), 4);
                healthPts[i]    = new HealthPt("ProgressBar10", 1, new Point(1200, 500 + 100 * i), 4);
            }

            // 說明頁物件
            explain        = new AnimateActor("story31", 1, new Point(550, 410), 2);
            rNextBtn       = new AnimateActor("Rnext", 1, new Point(1000, 430), 1.3f);
            ExplainPlayBtn = new AnimateActor("exPlay", 1, new Point(550, 630), 1); // 550 600
            lNextBtn       = new AnimateActor("graExpLBtn0", 1, new Point(100, 430), 1.3f);

            Global.target = yellowDragon[0].Enemys + yellowDragon[1].Enemys;
        }
Пример #4
0
        public TurnPage()
        {
            empty = new AnimateActor("empty", 11, new Point(200, 200), 0.01f);

            // GameOver
            gameOver   = new AnimateActor("gameOver", 5, new Point(560, 380), 1.5f);
            isGameOver = false;
        }
Пример #5
0
 //-------------建構子(初始化)-------------//
 public TurnTable()
 {
     music = new Music();
     //轉盤提醒 : 比例約1:1:2 ;以中心座標來放位置。
     clock = new AnimateActor("true", 1, new Point(760, 485), 1.5f);
     cycle = new AnimateActor("cycle", 1, new Point(760, 485), 1.5f);
     gobtn = new AnimateActor("transparent", 1, new Point(758, 485), 3f);
 }
Пример #6
0
        //---------------- 加在 Form1.MouseDown 裡 ----------------//
        public void MouseDown(MouseEventArgs e)
        {
            switch (step)
            {
            // 說明頁
            case 0:
                if (ExplainPlayBtn.isClick(e.X, e.Y))
                {
                    music.PlayMusic("concern.mp3");
                    ExplainPlayBtn.Size = 1.2f;
                    explain             = null;
                    ExplainPlayBtn      = null;
                    step = 1;
                }
                // 說明頁按鈕切換
                if (rNextBtn.isClick(e.X, e.Y) && (Global.Mode == 0 ? explainPage == 0  : false))
                {
                    music.PlayMusic("concern.mp3");
                    explainPage++;
                    rNextBtn.Size = 1.5f;
                }
                if (lNextBtn.isClick(e.X, e.Y) && (Global.Mode == 0 ? explainPage == 1 : false))
                {
                    music.PlayMusic("concern.mp3");
                    explainPage--;
                    lNextBtn.Size = 1.5f;
                }
                if ((rNextBtn.isClick(e.X, e.Y) || lNextBtn.isClick(e.X, e.Y)) && Global.Mode == 0)
                {
                    switch (explainPage)
                    {
                    case 0:
                        explain.ClearImages();
                        explain.AddImage("story22", 1);
                        lNextBtn.ClearImages();
                        lNextBtn.AddImage("graExpLBtn0", 1);
                        rNextBtn.ClearImages();
                        rNextBtn.AddImage("Rnext", 1);
                        break;

                    case 1:
                        explain.ClearImages();
                        explain.AddImage("story23", 1);
                        rNextBtn.ClearImages();
                        rNextBtn.AddImage("graExpRBtn0", 1);
                        lNextBtn.ClearImages();
                        lNextBtn.AddImage("Lnext", 1);
                        break;
                    }
                }
                break;

            //遊戲敗場
            case 3:
                turn.MouseDown(e, pageName.turntablePage);
                break;
            }
        }
Пример #7
0
        public void MouseUp(MouseEventArgs e)
        {
            switch (step)
            {
            // 說明頁
            case 0:
                if (ExplainPlayBtn.isClick(e.X, e.Y))
                {
                    ExplainPlayBtn.Size = 1;
                    explain             = null;
                    ExplainPlayBtn      = null;
                }
                if (rNextBtn.isClick(e.X, e.Y))
                {
                    rNextBtn.Size = 1.3f;
                }
                if (lNextBtn.isClick(e.X, e.Y))
                {
                    lNextBtn.Size = 1.3f;
                }

                // 說明頁 子頁 切換
                switch (explainPage)
                {
                case 0:
                    if (mainCharacter.isClick(e.X, e.Y))
                    {
                        mainCharacter.Motion(0);
                        mainCanJump = true;
                    }
                    break;

                case 2:
                    if (yellowDragon[0].isClick(e.X, e.Y))
                    {
                        yellowDragon[0].Motion(0);
                    }
                    break;
                }
                break;

            case 1:
                //續力結束
                ispower = false;
                //跳躍開始
                if (mainCharacter.isClick(e.X, e.Y) && mainCharacter.Center.Y > 545 && touch > 0)
                {
                    isjump = true;
                    mainCharacter.Motion(0);
                }
                break;
            }
        }
        public BrownDragon(string fileFirstName, int picturesNum, Point center, float size)
            : base(fileFirstName, picturesNum, center, size)
        {
            hp           = 100;
            countTime    = new CountTime();
            music        = new Music();
            brownDragon  = new AnimateActor(fileFirstName, picturesNum, center, size);
            pen          = new Pen(Color.Red, 5);
            myStartPoint = new Point(860, 510);
            myEndPoint   = new Point(860, 510);

            isAttack = false;
        }
Пример #9
0
        //-------------- Stage02 建構子 ---------------//
        public Stage02()
        {
            music = new Music("stage2.mp3");

            turn       = new TurnPage();
            randomizer = new Random();
            countTime  = new CountTime();

            tinyDragons = new TinyDragon[TINYDRAGON_NUM];
            fires       = new AnimateActor[Fire_MaX_Num];

            healthPts              = new HealthPt[HEALTHPTS_NUM];
            brownDragonHealthPt    = new HealthPt("ProgressBar10", 1, new Point(500, 500), 3);
            brownDragonHealthPt.hp = BROWNDRAGON_Max_HP;
            brownDragon            = new BrownDragon("browndragon", 2, new Point(1550, 500), 2); //950
            brownDragonImgWidth    = brownDragon.brownDragon.img.Width;
            brownDragonImgHeight   = brownDragon.brownDragon.img.Height;

            clouds = new ContinuousActor("clouds", 7, new Point(100, 100), 1, 400, 100, 5);

            mainCharator = new MainCharactor("flydragon", 2, new Point(200, 400), 5f);

            for (int i = 0; i < TINYDRAGON_NUM; i++)
            {
                tinyDragons[i] = new TinyDragon("tinyDragon", 3, new Point(1000 + 50 * i * randomizer.Next(1, 5), 0 + 50 * i * randomizer.Next(1, 10)), 3);
                healthPts[i]   = new HealthPt("ProgressBar10", 1, new Point(500, 500), 6);
            }

            pinkBk       = new AnimateActor("pinkBk", 1, new Point(500, 390), 1.5f);
            cloudsCenter = new Point(100, 100);

            healthPtCount = 0; // 記數 : tinyDragon 的死亡數量
            //MessageBox.Show("" + tinyDragons[0].img.Width);

            //------說明頁


            if (Global.Mode > 0)
            {
                explain = new AnimateActor("Stage02explain0", 1, new Point(550, 410), 2);
            }
            else
            {
                explain = new AnimateActor("story21", 1, new Point(550, 410), 2);
            }
            ExplainPlayBtn = new AnimateActor("exPlay", 1, new Point(550, 630), 1);
            rNextBtn       = new AnimateActor("Rnext", 1, new Point(1000, 450), 1.3f);
            lNextBtn       = new AnimateActor("graExpLBtn0", 1, new Point(100, 450), 1.3f);

            Global.target = 1;
        }
Пример #10
0
        public Stage01()
        {
            music = new Music("stage1.mp3");

            // 隨機背景
            clouds    = new ContinuousActor("clouds", 7, new Point(100, 100), 1, 400, 80, 5);
            mountains = new ContinuousActor("mountain", 6, new Point(100, 600), 1.2f, 350, 80, 0);
            grasses   = new ContinuousActor("Grass", 6, new Point(100, 658), 1.8f, 200, 80, 0);

            // 固定背景與物體
            background = new AnimateActor("bluesky", 1, new Point(800, 300), 1.3f);
            grass      = new AnimateActor("Grass11", 1, new Point(1000, 430), 1f);
            rainbow    = new AnimateActor("rainbow1", 1, new Point(1800, 300), 0.3f);

            // 動態互動物體
            stone = new AnimateActor("stone", 1, new Point(1100, 200), 3f);
            bone  = new AnimateActor("bone", 1, new Point(750, 450), 3);

            // 怪物們
            mainCharactor = new MainCharactor("dragon", 3, new Point(350, 500), 6);
            orangeDragon  = new OrangeDragon("orangedragon", 2, new Point(750, 500), 3);
            yellowBird    = new YellowBird("YellowBird", 3, new Point(1100, 100), 4);

            // 生命Bar
            healthyellow = new HealthPt("ProgressBar10", 1, new Point(1100, 0), 3);
            healthorange = new HealthPt("ProgressBar10", 1, new Point(1100, 500), 3);

            // 測試用按鈕
            playButton = new AnimateActor("Play1", 1, new Point(1000, 430), 15);
            newt       = new CountTime();

            // 說明頁物件
            if (Global.Mode > 0)
            {
                explain = new AnimateActor("explain2", 1, new Point(550, 410), 2);
            }
            else
            {
                explain = new AnimateActor("story11", 1, new Point(550, 410), 2);
            }
            ExplainPlayBtn = new AnimateActor("exPlay", 1, new Point(550, 630), 1); // 550 600
            oneHp01        = new AnimateActor("oneHp", 1, new Point(450, 390), 1);
            oneHp02        = new AnimateActor("oneHp", 1, new Point(750, 390), 1);
            rNextBtn       = new AnimateActor("Rnext", 1, new Point(1000, 430), 1.3f);
            lNextBtn       = new AnimateActor("graExpLBtn0", 1, new Point(100, 430), 1.3f);
            canPaintHp01   = false;
            canPaintHp02   = false;
            isAttackOrange = false;

            Global.target = orangeDragon.Enemys;
        }
Пример #11
0
        public MainpageStage()
        {
            music          = new Music("ep2.mp3");
            turn           = new TurnPage();
            foot           = new Foot();
            background     = new Actor("mainpageBackground", new Point(550, 394), 1.5f);
            dragon         = new MainCharactor("dragon", 2, new Point(0, 625), 7);
            playButton     = new AnimateActor("skip", 1, new Point(1030, 700), 1.2f);
            superragonLogo = new AnimateActor("Logo", 1, new Point(530, -200), 2);

            mainPageisStart = true;
            super_count     = 0;
            step            = 0;
        }
Пример #12
0
        //int explainPage = 0;
        //-------------- 放在 Form1.MouseDown 裡 ---------------//
        public void MouseDown(MouseEventArgs e)
        {
            switch (step)
            {
            // 說明頁
            case 0:
                if (ExplainPlayBtn.isClick(e.X, e.Y))
                {
                    music.PlayMusic("concern.mp3");
                    ExplainPlayBtn.Size = 1.2f;
                    explain             = null;
                    ExplainPlayBtn      = null;
                    step = 1;
                }
                break;

            //遊戲開始
            case 1:
                for (int i = 0; i < Fire_MaX_Num; i++)
                {
                    if (fires[i] == null)
                    {
                        music.PlayMusicMuti();
                        mainCharator.Motion(4);
                        fires[i] = new AnimateActor("fire", 4, new Point(mainCharator.Center.X + 60, mainCharator.Center.Y - 40), 1.5f);
                        GC.Collect();
                        break;
                    }
                }
                break;

            //遊戲敗場
            case 3:
                turn.MouseDown(e, pageName.turntablePage);
                break;
            }
        }
Пример #13
0
        public void MouseDown(MouseEventArgs e)
        {
            switch (step)
            {
            // 說明頁
            case 0:

                // 說明頁按鈕切換
                if (rNextBtn.isClick(e.X, e.Y) && (explainPage == 0 || explainPage == 1 || explainPage == 2))
                {
                    music.PlayMusic("concern.mp3");
                    explainPage++;
                    rNextBtn.Size = 1.5f;
                }
                if (lNextBtn.isClick(e.X, e.Y) && (explainPage == 1 || explainPage == 2 || explainPage == 3))
                {
                    music.PlayMusic("concern.mp3");
                    explainPage--;
                    lNextBtn.Size = 1.5f;
                }
                // 說明頁 子頁 切換
                switch (explainPage)
                {
                case 0:
                    explain.ClearImages();
                    explain.AddImage("story31", 1);

                    lNextBtn.ClearImages();
                    lNextBtn.AddImage("graExpLBtn0", 1);

                    rNextBtn.ClearImages();
                    rNextBtn.AddImage("Rnext", 1);
                    break;

                case 1:
                    explain.ClearImages();
                    explain.AddImage("Stage03explain0", 1);

                    lNextBtn.ClearImages();
                    lNextBtn.AddImage("Lnext", 1);

                    rNextBtn.ClearImages();
                    rNextBtn.AddImage("Rnext", 1);

                    // mainCharacter位置重設
                    mainCharacter.Size   = 8;
                    mainCharacter.Center = new Point(420, 430);
                    mainCharacter.Motion(0);

                    if (mainCharacter.isClick(e.X, e.Y))
                    {
                        mainCharacter.ispower = true;
                        music.PlayMusic("Power.mp3");
                        mainCharacter.Motion(5);
                    }

                    mainCharacter.isjump = false;
                    break;

                case 2:
                    explain.ClearImages();
                    explain.AddImage("Stage03explain1", 1);

                    rNextBtn.ClearImages();
                    rNextBtn.AddImage("Rnext", 1);

                    lNextBtn.ClearImages();
                    lNextBtn.AddImage("Lnext", 1);

                    // mainCharacter位置重設
                    mainCharacter.Size   = 8;
                    mainCharacter.Center = new Point(565, 550);
                    mainCharacter.Motion(2);

                    break;

                case 3:
                    explain.ClearImages();
                    explain.AddImage("Stage03explain2", 1);

                    rNextBtn.ClearImages();
                    rNextBtn.AddImage("graExpRBtn0", 1);

                    lNextBtn.ClearImages();
                    lNextBtn.AddImage("Lnext", 1);

                    if (yellowDragon[0].isClick(e.X, e.Y))
                    {
                        yellowDragon[0].Motion(1);
                    }
                    break;
                }


                if (ExplainPlayBtn.isClick(e.X, e.Y))
                {
                    music.PlayMusic("concern.mp3");
                    ExplainPlayBtn.Size = 1.2f;
                    explain             = null;
                    ExplainPlayBtn      = null;

                    // mainCharater 位置、 圖片重設
                    mainCharacter.Size   = 6;
                    mainCharacter.Center = new Point(190, 590);
                    mainCharacter.Motion(0);

                    // river 、 river2 位置、圖片重設
                    river.Size    = 1;
                    river.Center  = new Point(500, 750);
                    river2.Size   = 1;
                    river2.Center = new Point(500, 750);

                    // yellowDragon 位置、圖片重設
                    for (int i = 0; i < yellow_NUM; i++)
                    {
                        yellowDragon[i] = new YellowDragon("yellowdragon", 2, new Point(1200, 500 + 100 * i), 3);
                    }

                    step = 1;
                }


                break;

            case 1:
                //攻擊敵人
                for (int i = 0; i < yellow_NUM; i++)
                {
                    if (yellowDragon[i] != null)
                    {
                        if (yellowDragon[i].isClick(e.X, e.Y))
                        {
                            yellowDragon[i].Life();
                            yellowDragon[i].Motion(1);
                        }
                    }
                }
                //續力開始
                if (mainCharacter.isClick(e.X, e.Y) && mainCharacter.Center.Y > 545 && touch > 0 && !mainCharacter.isjump)
                {
                    music.PlayMusic("Power.mp3");
                    mainCharacter.ispower = true;
                    mainCharacter.Motion(5);
                }
                break;

            //遊戲敗場
            case 3:
                turn.MouseDown(e, pageName.turntablePage);
                break;
            }
        }
Пример #14
0
        //---------- MouseDouwn -------------//
        public void MouseDown(MouseEventArgs e)
        {
            switch (step)
            {
            // 說明頁
            case 0:
                if (Form1.labely.Visible == true)
                {
                    Form1.labely.Visible = false;
                    Form1.labelz.Visible = false;
                }
                if (ExplainPlayBtn.isClick(e.X, e.Y))
                {
                    music.PlayMusic("concern.mp3");
                    ExplainPlayBtn.Size = 1.2f;
                    explain             = null;
                    ExplainPlayBtn      = null;

                    mainCharactor.Center = new Point(195, 600);
                    orangeDragon.Center  = new Point(1100, 600);
                    yellowBird.Center    = new Point(1100, 100);
                    bone.Center          = new Point(1050, 580);

                    mainCharactor.Motion(0);
                    orangeDragon.Motion(0);

                    step = 1;
                }
                if (mainCharactor.isClick(e.X, e.Y) && explainPage == 1)
                {
                    mainCharactor.Motion(1);
                    escaption    = true;
                    canPaintHp01 = false;
                }
                if (orangeDragon.isClick(e.X, e.Y) && explainPage == 1)
                {
                    orangeDragon.Motion(2);
                    canPaintHp02   = true;
                    isAttackOrange = true;
                }
                // 說明頁按鈕切換
                if (rNextBtn.isClick(e.X, e.Y) && (Global.Mode == 0 ? (explainPage == 0 || explainPage == 1 || explainPage == 2) : (explainPage == 0 || explainPage == 1)))
                {
                    music.PlayMusic("concern.mp3");
                    explainPage++;
                    rNextBtn.Size = 1.5f;
                }
                if (lNextBtn.isClick(e.X, e.Y) && (Global.Mode == 0 ? (explainPage == 1 || explainPage == 2 || explainPage == 3) : (explainPage == 1 || explainPage == 2)))
                {
                    music.PlayMusic("concern.mp3");
                    explainPage--;
                    lNextBtn.Size = 1.5f;
                }
                // 說明頁切換
                if (rNextBtn.isClick(e.X, e.Y) || lNextBtn.isClick(e.X, e.Y))
                {
                    switch (explainPage)
                    {
                    case 0:
                        explain.ClearImages();
                        if (Global.Mode > 0)
                        {
                            explain.AddImage("explain2", 1);
                        }
                        else
                        {
                            explain.AddImage("story11", 1);
                        }
                        lNextBtn.ClearImages();
                        lNextBtn.AddImage("graExpLBtn0", 1);
                        rNextBtn.ClearImages();
                        rNextBtn.AddImage("Rnext", 1);
                        break;

                    case 1:
                        explain.ClearImages();
                        if (Global.Mode > 0)
                        {
                            explain.AddImage("explain0", 1);
                        }
                        else
                        {
                            explain.AddImage("story12", 1);
                        }
                        rNextBtn.ClearImages();
                        rNextBtn.AddImage("Rnext", 1);
                        lNextBtn.ClearImages();
                        lNextBtn.AddImage("Lnext", 1);
                        break;

                    case 2:
                        explain.ClearImages();
                        rNextBtn.ClearImages();
                        if (Global.Mode > 0)
                        {
                            explain.AddImage("explain1", 1);
                            rNextBtn.AddImage("graExpRBtn0", 1);
                        }
                        else
                        {
                            explain.AddImage("story13", 1);
                            rNextBtn.AddImage("Rnext", 1);
                        }
                        lNextBtn.ClearImages();
                        lNextBtn.AddImage("Lnext", 1);
                        break;

                    case 3:
                        explain.ClearImages();
                        explain.AddImage("story14", 1);
                        rNextBtn.ClearImages();
                        rNextBtn.AddImage("graExpRBtn0", 1);
                        lNextBtn.ClearImages();
                        lNextBtn.AddImage("Lnext", 1);
                        break;
                    }
                }
                break;

            //遊戲開始
            case 1:
                if (playButton.isClick(e.X, e.Y))
                {
                    step = 2;
                }
                if (mainCharactor.isClick(e.X, e.Y))
                {
                    mainCharactor.Motion(1);
                    escaption = true;
                }
                if (orangeDragon.isClick(e.X, e.Y))
                {
                    orangeDragon.Motion(2);
                    orangeDragon.Life();
                    music.PlayMusic("AnemyHit.mp3");
                }
                if (yellowBird.isClick(e.X, e.Y))
                {
                    yellowBird.Motion(1);
                    yellowBird.Throw();
                    music.PlayMusic("AnemyHit.mp3");
                }
                break;

            //遊戲敗場
            case 3:
                turn.MouseDown(e, pageName.turntablePage);
                break;
            }
        }
Пример #15
0
        //-------------Form 呼叫的 MouseDown-------------//
        public void MouseDown(MouseEventArgs e)
        {
            switch (step)
            {
            // 說明頁
            case 0:
                if (ExplainPlayBtn.isClick(e.X, e.Y))
                {
                    music.PlayMusic("concern.mp3");
                    ExplainPlayBtn.Size = 1.2f;
                    explain             = null;
                    ExplainPlayBtn      = null;
                    WingL = null;
                    WingR = null;
                    WingL = new AnimateActor("wing0", 2, new Point(200, 320), 1.5f);
                    WingR = new AnimateActor("wing1", 2, new Point(900, 320), 1.5f);
                    step  = 1;
                }
                // 說明頁按鈕切換
                if (rNextBtn.isClick(e.X, e.Y) && explainPage == 0 && Global.Mode > 0)
                {
                    music.PlayMusic("concern.mp3");
                    explain.ClearImages();
                    explain.AddImage("Level01explain1", 1);

                    explainPage   = 1;
                    rNextBtn.Size = 1.5f;

                    rNextBtn.ClearImages();
                    rNextBtn.AddImage("graExpRBtn0", 1);

                    lNextBtn.ClearImages();
                    lNextBtn.AddImage("Lnext", 1);
                }
                if (lNextBtn.isClick(e.X, e.Y) && explainPage == 1 && Global.Mode > 0)
                {
                    music.PlayMusic("concern.mp3");
                    explain.ClearImages();
                    explain.AddImage("Level01explain0", 1);

                    explainPage   = 0;
                    lNextBtn.Size = 1.5f;

                    lNextBtn.ClearImages();
                    lNextBtn.AddImage("graExpLBtn0", 1);

                    rNextBtn.ClearImages();
                    rNextBtn.AddImage("Rnext", 1);
                }
                break;

            //遊戲開始
            case 1:
                if (Cloud.isClick(e.X, e.Y))
                {
                    if (e.X > Cloud.Center.X)
                    {
                        music.PlayMusic("cloudsClick.mp3");
                        Cloud._Angle += Convert.ToInt32(Math.Sqrt(Math.Pow(e.X - Cloud.Center.X, 2) + Math.Pow(e.Y - Cloud.Center.Y, 2)) / 50);
                    }
                    else if (e.X < Cloud.Center.X)
                    {
                        music.PlayMusic("cloudsClick.mp3");
                        Cloud._Angle -= Convert.ToInt32(Math.Sqrt(Math.Pow(e.X - Cloud.Center.X, 2) + Math.Pow(e.Y - Cloud.Center.Y, 2)) / 50);
                    }
                }
                break;

            //遊戲敗場
            case 3:
                turn.MouseDown(e, pageName.turntablePage);
                break;
            }
        }
Пример #16
0
        public void Action()
        {
            switch (step)
            {
            //遊戲進場說明
            case 0:
                Thread.Sleep(100);
                river.Action();
                river2.AntiAction();
                // 說明頁切換
                switch (explainPage)
                {
                case 1:
                    // mainCharater 動作
                    mainCharacter.Action();
                    mainCharacter.Jump(-7, 430);
                    break;

                case 2:
                    mainCharacter.Action();
                    break;

                case 3:
                    // yellowDragon 動作
                    yellowDragon[0].Action();
                    if (yellowDragon[0].Center.Y <= 350)
                    {
                        isUp = false;
                    }
                    else if (yellowDragon[0].Center.Y >= 600)
                    {
                        isUp = true;
                    }
                    if (isUp)
                    {
                        yellowDragon[0].Move(0, -20);
                    }
                    else if (!isUp)
                    {
                        yellowDragon[0].Move(0, 20);
                    }
                    break;
                }
                break;

            //遊戲開始
            case 1:
                countTime.StartT();
                Thread.Sleep(90);
                music.PlayMusic(4);

                if (yellowDragon[0] == null && yellowDragon[1] == null)
                {
                    if (winroad.Center.X < 520)
                    {
                        pinkDragon.Action();
                        pinkDragon.Move(-4, 0);
                        if (pinkDragon.isClick(mainCharacter.Center.X + 50, mainCharacter.Center.Y))
                        {
                            step = 5;
                        }
                    }
                    else
                    {
                        winroad.Move(-10, 0);
                        pinkDragon.Move(-10, 0);
                    }
                }

                // 所有圖片動畫
                if (winroad.Center.X > 520)
                {
                    river.Action();
                    river2.AntiAction();
                    grid.Action(-160, new Point(1900, 700), -10, 0);
                    background.Action(-440, new Point(1700, 340), -3, 0);
                }
                mainCharacter.Action();

                //---------------- Enemys
                Global.target = 0;
                for (int i = 0; i < yellow_NUM; i++)
                {
                    if (yellowDragon[i] != null)
                    {
                        Global.target += yellowDragon[i].Enemys;
                        yellowDragon[i].Action();
                        yellowDragon[i].Jump(grid.continuousActors[grid.continuousActors.Count - 1].Center, i);
                        if (yellowDragon[i].isClick(mainCharacter.Center.X, mainCharacter.Center.Y))
                        {
                            Console.WriteLine("撞到哪一隻 :" + i);
                            Global.HP -= 1;
                            music.PlayMusic(1);
                            if (Global.HP <= 0)
                            {
                                step = 3;
                            }
                            mainCharacter.Motion(2);
                        }
                        healthPts[i].Center = new Point(yellowDragon[i].Center.X, yellowDragon[i].Center.Y - 120);
                        healthPts[i].Health(yellowDragon[i].HP, 5);
                        if (yellowDragon[i].Enemys == 0 && yellowDragon[i] != null)
                        {
                            yellowDragon[i] = null;
                        }
                    }
                }

                // 恐龍是否走在路上
                touch = 0;
                for (int i = 0; i < grid.continuousActors.Count; i++)
                {
                    if (grid.continuousActors[i].isClick(mainCharacter.Center.X - 15, mainCharacter.Center.Y + 60))
                    {
                        touch++;
                        if (mainCharacter.Center.Y > 630)
                        {
                            touch--;
                        }
                    }
                }
                // 恐龍動作(跳/墜落)

                if (winroad.Center.X <= 750)
                {
                    mainCharacter.Center = new Point(mainCharacter.Center.X + 4, 550);
                }
                else
                {
                    mainCharacter.Jump2(-30, touch);
                }


                // 恐龍扣血
                if (mainCharacter.Center.Y > 950)
                {
                    Global.HP -= 1;
                    music.ContiPlayMusic("drop.wav");
                    if (Global.HP <= 0)
                    {
                        step = 3;
                    }
                    mainCharacter.Motion(2);
                    mainCharacter.Center = new Point(190, 190);
                    mainCharacter.t      = 0;
                    mainCharacter.isjump = false;
                }

                // 計時直到碰見粉紅
                if (!pinkDragon.isClick(mainCharacter.Center.X, mainCharacter.Center.Y))
                {
                    countTime.EndT();
                }
                break;

            //遊戲勝場
            case 2:
                music.StopMusic("cave2.wav");
                turn.TurnWin(pageName.mainPage);
                break;

            //遊戲敗場
            case 3:
                music.StopMusic("cave2.wav");
                turn.TurnGameOver(pageName.mainPage);
                break;

            case 4:
                Ranker ranker = new Ranker();
                ranker.Load();
                ranker.Clear();
                ranker.ShowRank(0);
                step = 6;
                break;

            case 5:
                switch (End)
                {
                case 0:
                    explain = new AnimateActor("story32", 1, new Point(550, 410), 2);
                    End     = 1;
                    Thread.Sleep(3500);
                    break;

                case 1:
                    explain.ClearImages();
                    explain.AddImage("story33", 1);
                    music.PlayMusic("hurt3.mp3");
                    End = 2;
                    Thread.Sleep(1000);
                    break;

                case 2:
                    explain.ClearImages();
                    explain.AddImage("story34", 1);
                    End = 3;
                    Thread.Sleep(2500);
                    music = null;
                    music = new Music("Stage1.mp3");
                    break;

                case 3:
                    explain.ClearImages();
                    explain.AddImage("story35", 1);
                    End = 4;
                    Thread.Sleep(2500);
                    break;

                case 4:
                    explain.ClearImages();
                    explain.AddImage("story36", 1);
                    Thread.Sleep(3500);
                    step = 4;
                    music.PlayMusic("Pass.mp3");
                    break;
                }

                break;

            case 6:
                turn.TurnWin(pageName.mainPage);
                break;
            }
        }
Пример #17
0
        int actorChange = 0; // 角色瀏覽標籤

        //------------ TurnTableStage 建構子 ----------//
        public TurnTableStage()
        {
            turn        = new TurnPage();
            ranker      = new Ranker();
            music       = new Music(5);
            turnTable   = new TurnTable();
            click       = 1;
            Global.TIME = 0;
            ranker.Load();

            wood       = new Actor("wood", new Point(250, 390), 0.9f);
            background = new Actor("mainpageBackground", new Point(550, 394), 1.5f);
            rankpic    = new Button("rank0", 1, new Point(795, 350), 1.3f);

            Page         = new Button("redPage", 1, new Point(760, 365), 1.06f);
            redButton    = new Button("redButton0", 2, new Point(150, 160), 1.5f);
            blueButton   = new Button("blueButton0", 2, new Point(150, 460), 1.5f);
            greenButton  = new Button("greenButton0", 2, new Point(250, 310), 1.5f);
            purpleButton = new Button("purpleButton0", 2, new Point(250, 610), 1.5f);

            nextButtonLeft  = new AnimateActor("nextButton0", 1, new Point(710, 670), 13);
            nextButtonRight = new AnimateActor("nextButton1", 1, new Point(805, 670), 13);
            intro0          = new AnimateActor("intro0", 1, new Point(765, 200), 1);
            intro1          = new AnimateActor("intro1", 1, new Point(765, 200), 1);
            intro2          = new AnimateActor("intro2", 1, new Point(765, 200), 1);
            intro3          = new AnimateActor("intro3", 1, new Point(765, 200), 1);
            intro4          = new AnimateActor("intro4", 1, new Point(765, 200), 1);
            intro5          = new AnimateActor("intro5", 1, new Point(765, 200), 1);
            intro6          = new AnimateActor("intro6", 1, new Point(765, 200), 1);

            greenDragon  = new MainCharactor("dragon", 2, new Point(775, 500), 4.5f);
            orangeDragon = new OrangeDragon("orangedragon", 2, new Point(770, 500), 2.5f);
            bird         = new YellowBird("YellowBird_Hit", 3, new Point(775, 500), 2.5f);
            tinyDragon   = new TinyDragon("tinyDragon", 3, new Point(760, 500), 2f);
            brownDragon  = new AnimateActor("browndragon", 2, new Point(750, 500), 2.5f);
            blackDragon  = new BlackDragon("blackdragon", 2, new Point(735, 500), 5);
            yellowDragon = new YellowDragon("yellowdragon", 2, new Point(755, 500), 2.5f);


            nameTextbox = new TextBox();
            SetNameTextbox();
            pageLabel = new Label();
            SetPageLabel();
            turnLabel = new Label();
            SetTurnLabel();

            mode01           = new AnimateActor("Mode0", 1, new Point(550, 600), 2f);
            mode02           = new AnimateActor("Mode1", 1, new Point(760, 600), 2f);
            storyMode        = new AnimateActor("Story0", 1, new Point(970, 600), 2f);;
            storyModeExplain = new AnimateActor("modeStory0", 1, new Point(750, 335), 2.55f);

            cloud = new AnimateActor("cloud", 1, new Point(760, 55), 1);
            // 模式按鈕
            switch (Global.Mode)
            {
            case 0:
                rBtn0 = new AnimateActor("rrBtn0", 1, new Point(550, 175), 1.5f);
                rBtn1 = new AnimateActor("rBtn1", 1, new Point(750, 175), 1.5f);
                rBtn2 = new AnimateActor("rBtn2", 1, new Point(960, 175), 1.5f);
                break;

            case 1:
                rBtn0 = new AnimateActor("rBtn0", 1, new Point(550, 175), 1.5f);
                rBtn1 = new AnimateActor("rrBtn1", 1, new Point(750, 175), 1.5f);
                rBtn2 = new AnimateActor("rBtn2", 1, new Point(960, 175), 1.5f);
                break;

            case 2:
                rBtn0 = new AnimateActor("rBtn0", 1, new Point(550, 175), 1.5f);
                rBtn1 = new AnimateActor("rBtn1", 1, new Point(750, 175), 1.5f);
                rBtn2 = new AnimateActor("rrBtn2", 1, new Point(960, 175), 1.5f);
                break;
            }
        }