⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 maincanvas.java

📁 机器人大战MetalEN
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
            {
                " While jumping,", "press the 2", "key again to", "jump higher."
            }, {
                " Press RIGHT", "/6 key to", "move right", " Press LEFT", "/4 key to", "move left"
            }, {
                " Press UP/", "2 key to", "jump", " Press DOWN/", "8 key to", "jump down"
            }, {
                " Press the", "5 key to", "shoot", " No key", "pressed:", "guard"
            }
        };
        int ai1[] = {
            4, 6, 6, 6
        };
        int ai2[][][] = {
            {
                {
                    4, 1, 2, 7
                }, {
                    4, 1, 2, 7
                }
            }, {
                {
                    0, 0, 0, 0
                }, {
                    2, 3, 3, 3
                }
            }
        };
        int l;
        if(nOld_Chapter == 2)
            l = 0;
        else
            l = 1;
        int k = ik;
        ik = 0;
        if((k & 0x8002) != 0)
        {
            nCursor[nMenu[0]]--;
            if(nCursor[nMenu[0]] < 0)
                nCursor[nMenu[0]] = 4;
        } else
        if((k & 0x200004) != 0)
        {
            nCursor[nMenu[0]]++;
            if(nCursor[nMenu[0]] > 4)
                nCursor[nMenu[0]] = 0;
        } else
        {
            if((k & 0x80) != 0)
            {
                Game_MainChapter = abyte1[l][nMenu[0]];
                SoftKeyName(ai2[1][l][nMenu[0]]);
                nMenu[0] = 0;
                nMenu[1] = 0;
                return;
            }
            if((k & 0x40440) != 0)
            {
                if(nMenu[0] == 3)
                {
                    Game_MainFlag ^= 0x8;
                    if((Game_MainFlag & 0x8) != 0)
                        DeviceControl.setLights(0, 100);
                    else
                        DeviceControl.setLights(0, 0);
                }
                nMenu[0] = ai[nCursor[0]];
                nMenu[1]++;
                if(nMenu[1] > 3)
                    nMenu[1] = 0;
                Game_MainChapter = abyte0[l][nCursor[0]];
                SoftKeyName(ai2[0][l][nMenu[0]]);
                return;
            }
        }
        nMenuCount = nMenuCount - 1 & 0x7;
        offGfx.setClip(Draw_Zero_X, Draw_Zero_Y, 112, 112);
        offGfx.setColor(0, 0, 128);
        offGfx.fillRect(Draw_Zero_X, Draw_Zero_Y, 112, 112);
        switch(nMenu[0])
        {
        default:
            break;

        case 0: // '\0'
            offGfx.setColor(nMenuCount * 18, nMenuCount * 18, nMenuCount * 18 + 128);
            offGfx.fillRect(Draw_Zero_X, 24 + nCursor[0] * 16 + Draw_Zero_Y, 112, 16);
            for(int i = 0; i < 5; i++)
            {
                if(i == nCursor[0])
                    offGfx.setColor(255, 255, 255);
                else
                    offGfx.setColor(128, 128, 128);
                offGfx.drawString(as[l][i], (112 - FontC.stringWidth(as[l][i])) / 2 + Draw_Zero_X, 24 + i * 16 + Draw_Zero_Y, 0);
            }

            break;

        case 1: // '\001'
            offGfx.setColor(255, 255, 255);
            for(int j = 0; j < ai1[nMenu[1]]; j++)
                offGfx.drawString(as2[nMenu[1]][j], Draw_Zero_X, j * 16 + Draw_Zero_Y, 0);

            offGfx.drawString(((nMenu[1] - 1 & 0x3) + 1) + "/4", (112 - FontC.stringWidth(((nMenu[1] - 1 & 0x3) + 1) + "/3")) + Draw_Zero_X, (112 - FontC.getHeight()) + Draw_Zero_Y, 0);
            break;

        case 2: // '\002'
            offGfx.setColor(255, 255, 255);
            offGfx.drawString("MetalAndroid", (112 - FontC.stringWidth("MetalAndroid")) / 2 + Draw_Zero_X, 16 + Draw_Zero_Y, 0);
            offGfx.drawString("Ver 1.0.0", (112 - FontC.stringWidth("Ver 1.0.0")) / 2 + Draw_Zero_X, 32 + Draw_Zero_Y, 0);
            offGfx.drawString("DigitalZero", (112 - FontC.stringWidth("DigitalZero")) / 2 + Draw_Zero_X, 48 + Draw_Zero_Y, 0);
            break;

        case 3: // '\003'
            offGfx.setColor(255, 255, 255);
            offGfx.drawString("Backlight", (112 - FontC.stringWidth("Backlight")) / 2 + Draw_Zero_X, 16 + Draw_Zero_Y, 0);
            if((Game_MainFlag & 0x8) != 0)
                offGfx.drawString("On", (112 - FontC.stringWidth("On")) / 2 + Draw_Zero_X, 32 + Draw_Zero_Y, 0);
            else
                offGfx.drawString("Off", (112 - FontC.stringWidth("Off")) / 2 + Draw_Zero_X, 32 + Draw_Zero_Y, 0);
            break;
        }
    }

    public void ChapterSelectInit()
    {
        Game_MainFlag &= 0xfffffffe;
        Game_MainFlag &= 0xfffffffd;
        Game_MainTimer = 0;
        Game_SubTimer = 0;
        FillRect(0, 0, 0);
        ik = 0;
        Img_Title = null;
        SoftKeyName(0);
        Game_MainChapter = 4;
    }

    public void ChapterSelect()
    {
        SelectKeyIO();
        SelectMain();
        SelectDraw();
    }

    public void SelectKeyIO()
    {
        int i = ik;
        ik = 0;
        if((Game_MainFlag & 0x1) == 0)
            if((i & 0x208006) != 0)
                My_Weapon = (byte)(My_Weapon + 1 & 0x1);
            else
            if((i & 0x40440) != 0)
            {
                Game_SubChapter = 18;
                Game_MainFlag |= 0x1;
                Game_MainFlag |= 0x2;
            }
    }

    public void SelectMain()
    {
        Game_MainTimer = Game_MainTimer + 1 & 0x1f;
        Game_SubTimer = WipeOutMain(Game_SubTimer);
    }

    public void SelectDraw()
    {
        FillRect(0, 0, 0);
        offGfx.setClip(Draw_Zero_X, Draw_Zero_Y, 112, 112);
        LatticeDraw(Game_MainTimer, 0, 96, 0);
        offGfx.setColor(36 * (7 - (Game_MainTimer & 0x7)), 18 * (7 - (Game_MainTimer & 0x7)), 0);
        offGfx.fillRect(35 * (My_Weapon + 1 & 0x1) + Draw_Zero_X, 35 + 39 * My_Weapon + Draw_Zero_Y, 77, 8);
        offGfx.setColor(255, 255, 255);
        DrawString("Select Pilot", 0, 0);
        offGfx.drawImage(Img_Pilot[0], Draw_Zero_X, 24 + Draw_Zero_Y, 0);
        offGfx.setColor(128, 128, 255);
        DrawString("High Power", 35, 27);
        offGfx.drawImage(Img_Pilot[1], 77 + Draw_Zero_X, 63 + Draw_Zero_Y, 0);
        offGfx.setColor(255, 128, 128);
        DrawString("3Way Shots", 0, 66);
        WipeOutDraw(Game_SubTimer);
    }

    public void ChapterLoadImageInit()
    {
        Game_MainFlag &= 0xfffffffd;
        Game_MainTimer = 0;
        Game_SubTimer = 0;
        SoftKeyName(4);
        FillRect(0, 0, 0);
        Game_MainChapter = 16;
    }

    public void ChapterLoadImage()
    {
        int ai[] = {
            28, 28, 28, 14, 24, 27
        };
        switch(Game_MainTimer)
        {
        default:
            break;

        case 0: // '\0'
            Img_Enemy = null;
            Img_EnemyShot = null;
            Img_Exp = null;
            Img_Back = null;
            switch(Game_Stage)
            {
            case 3: // '\003'
                Img_Enemy = new Image[1][1];
                Img_EnemyShot = new Image[5];
                Img_Exp = new Image[5];
                break;

            case 4: // '\004'
                Img_Enemy = new Image[2][4];
                Img_EnemyShot = new Image[5];
                Img_Exp = new Image[9];
                break;

            case 5: // '\005'
                Img_Enemy = new Image[1][1];
                Img_EnemyShot = new Image[16];
                Img_Exp = new Image[9];
                break;

            default:
                Img_Enemy = new Image[2][10];
                Img_EnemyShot = new Image[5];
                Img_Exp = new Image[5];
                break;
            }
            Run.gc();
            GameInitStage(Game_Stage);
            Game_MainTimer++;
            Game_SubTimer++;
            break;

        case 1: // '\001'
            switch(Game_Stage)
            {
            case 3: // '\003'
                LoadBossImage(1);
                Point = 999;
                break;

            case 4: // '\004'
                LoadEnemy01Image();
                break;

            case 5: // '\005'
                LoadBossImage(0);
                Point = 999;
                break;

            default:
                LoadEnemy00Image();
                break;
            }
            Game_SubTimer++;
            if(Point >= 999)
            {
                Game_MainTimer++;
                Point = 0;
            }
            break;

        case 2: // '\002'
            LoadExp0Image();
            Game_SubTimer++;
            if(Point >= 999)
            {
                Game_MainTimer++;
                Point = 0;
            }
            break;

        case 3: // '\003'
            switch(Game_Stage)
            {
            case 4: // '\004'
            case 5: // '\005'
                LoadExp1Image();
                break;

            default:
                Point = 999;
                break;
            }
            Game_SubTimer++;
            if(Point >= 999)
            {
                Game_MainTimer++;
                Point = 0;
            }
            break;

        case 4: // '\004'
            LoadEnemyShotImage();
            Game_SubTimer++;
            if(Point >= 999)
            {
                Game_MainTimer++;
                Point = 0;
            }
            break;

        case 5: // '\005'
            switch(Game_Stage)
            {
            case 3: // '\003'
                Img_EnemyShot[3] = Img_Exp[2];
                Point = 999;
                break;

            case 5: // '\005'
                LoadBossShotImage();
                break;

            default:
                Point = 999;
                break;
            }
            Game_SubTimer++;
            if(Point >= 999)
            {
                Game_MainTimer++;
                Point = 0;
            }
            break;

        case 6: // '\006'
            switch(Game_Stage)
            {
            case 0: // '\0'
                LoadBackImage(1);
                break;

            case 2: // '\002'
            case 3: // '\003'
            case 4: // '\004'
                LoadBackImage(0);
                break;

            case 5: // '\005'
                LoadBackImage(2);
                break;
            }
            Game_SubTimer++;
            Game_MainChapter = 5;
            Point = 0;
            Game_MainTimer = 0;
            Run.gc();
            break;
        }
        FillRect(0, 0, 0);
        offGfx.setClip(Draw_Zero_X, Draw_Zero_Y, 112, 112);
        PieChartDraw(Game_SubTimer, ai[Game_Stage]);
    }

    public void ChapterTargetInit()
    {
        Game_MainFlag &= 0xfffffffe;
        Game_MainFlag &= 0xfffffffd;
        Game_MainTimer = 0;
        Game_SubTimer = 0;
        SoftKeyName(6);
        FillRect(0, 0, 0);
        ik = 0;
        Game_MainChapter = 6;
    }

    public void ChapterTarget()
    {
        TargetKeyIO();
        TargetMain();
        TargetDraw();
    }

    public void TargetKeyIO()
    {
        if((Game_MainFlag & 0x1) == 0 && (ik & 0x44440) != 0)
        {
            Game_SubChapter = 7;
            ik = 0;
            Game_MainFlag |= 0x1;
            Game_MainFlag |= 0x2;
            return;
        } else
        {
            return;
        }
    }

    public void TargetMain()
    {
        Game_MainTimer = Game_MainTimer + 1 & 0x1f;
        Game_SubTimer = WipeOutMain(Game_SubTimer);
    }

    public void TargetDraw()
    {
        String as[][] = {
            {
                "Destroy wall,", "Annihilate", "Open locks in", "Destroy ", "Clear out enemies", "Destroy the"
            }, {
                "enter building", "all enemies", "the 4 corners", "the Guardian", "in airlock", "Mother Alien"
            }
        };
        FillRect(0, 0, 0);
        offGfx.setClip(Draw_Zero_X, Draw_Zero_Y, 112, 112);
        LatticeDraw(Game_MainTimer, 0, 128, 0);
        offGfx.setColor(255, 255, 255);
        DrawString("Stage " + (Game_Stage + 1), 0, 0);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -