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

📄 rollercanvas.java

📁 龙石游戏源代码!需要的下载!
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
                break;

            case 9: // '\t'
                imageReady = true;
                break;
            }
            loadstage++;
        }
        catch(Exception e)
        {
            System.out.println("error in load images");
        }
    }

    public int GetRandomNo(int iMaxValue)
    {
        int iVal = ranObj.nextInt() % iMaxValue;
        if(iVal < 0)
            iVal *= -1;
        return iVal;
    }

    void PaintMap(int x, int y, int w, int h, int z)
    {
        if(y < 0)
            y = 0;
        for(int a = x; a <= (x - 1) + w; a++)
        {
            for(int b = y; b <= (y - 1) + h; b++)
                bit[a][b] = (byte)z;

        }

    }

    int EnemyCount()
    {
        int enemies = 0;
        for(int m = 1; m <= usedmen; m++)
            if(man[m].team == 2 && man[m].life > 0 && man[m].action != WAIT)
                enemies++;

        return enemies;
    }

    void CheckBossDie()
    {
        if(showstageclear < 1)
        {
            int bosses = 0;
            for(int m = 1; m <= usedmen; m++)
            {
                if(man[m].backupaction == BOSS1 && man[m].life > 0)
                    bosses++;
                if(man[m].backupaction == BOSS2 && man[m].life > 0)
                    bosses++;
                if(man[m].backupaction == BOSS3 && man[m].life > 0)
                    bosses++;
                if(man[m].backupaction == BOSS4 && man[m].life > 0)
                    bosses++;
            }

            if(bosses < 1 && endofstage > 0)
            {
                showstageclear = 1;
                DoBomb();
            }
        }
    }

    void DoBomb()
    {
        for(int m = 1; m <= usedmen; m++)
            if(man[m].team == 2 && man[m].action > 0)
            {
                man[m].life = 0;
                InitAction(man[m], PK);
                man[m].team = 0;
            }

        if(showstageclear < 1)
            CheckBossDie();
    }

    int NewCol(int x, int y, int z, int team)
    {
        int c = NewCol(x, y, z, 20, 10, 10, team);
        return c;
    }

    int NewCol(int x, int y, int z, int rangex, int rangey, int rangez, int team)
    {
        int c = ++nextcol;
        if(nextcol > maxcol)
            c = nextcol = 1;
        col[c].team = team;
        col[c].x = x;
        col[c].y = y;
        col[c].z = z;
        col[c].rangex = rangex;
        col[c].rangey = rangey;
        col[c].rangez = rangez;
        col[c].pow = 10;
        col[c].pow2 = 40;
        return c;
    }

    void DoCol()
    {
        int w = 20;
        int h = 50;
        for(int c = 1; c <= maxcol; c++)
        {
            for(int m = 1; m <= usedmen; m++)
            {
                if(col[c].team != 3 - man[m].team || col[c].x + col[c].rangex <= man[m].x - w || col[c].x - col[c].rangex >= man[m].x + w || col[c].y + col[c].rangey <= man[m].y || col[c].y - col[c].rangey >= man[m].y || col[c].z + col[c].rangez <= man[m].z - h || col[c].z - col[c].rangez >= man[m].z || man[m].invtimer >= 1)
                    continue;
                man[m].life2 -= col[c].pow2;
                man[m].life -= col[c].pow;
                if(man[m].life < 0)
                    man[m].life = 0;
                InitAction(man[m], STUN);
                tp.playSound1();
                if(man[m].x < col[c].x)
                    man[m].dirx = 1;
                if(man[m].x > col[c].x)
                    man[m].dirx = -1;
            }

            col[c].team = 0;
        }

    }

    void InitStage(int s)
    {
        borderleft = arealeft;
        bordertop = areatop;
        borderright = 1000;
        borderbottom = 1000;
        scrollspeedx = 0;
        scrx = borderleft;
        stage = s;
        ailevel = 1;
        if(stage > 1)
            ailevel = 2;
        if(stage > 3)
            ailevel = 3;
        showtitle = 0;
        showcongratulations = 0;
        showgameover = 0;
        showtimeover = 0;
        showstageclear = 0;
        showfadeout = 0;
        showfadein = 20;
        showready = 1;
        int color = 0;
        usedmen = 0;
        useddrawlist = 0;
        for(int m = 1; m <= maxmen; m++)
            KillMan(man[m]);

        for(int i = 1; i <= maxdrawlist; i++)
            KillMan(drawlist[i]);

        for(int i = 1; i <= maxlist; i++)
            list[i] = 0;

        PaintMap(0, 0, 150, 50, -100);
        myman = 0;
        endofstage = 0;
        GetStory(1);
    }

    void GetStory(int s)
    {
        shiftx = arealeft;
        shifty = areatop;
        story = s;
        usedid = 0;
        for(int m = 1; m <= usedmen; m++)
            if(man[m].x < scrx - 200)
                KillMan(man[m]);

        for(int i = 1; i <= useddrawlist; i++)
            KillMan(drawlist[i]);

        useddrawlist = 0;
        borderleft = scrx;
        sectionx = waitx = scrx + 150;
        System.out.println("getstory");
        if(stage == 1)
        {
            PutImage(480, 140, 26);
            PutImage(720, 140, 26);
            PutImage(809, 38, 28);
            PutImage(800, 140, 26);
            PutImage(640, 140, 26);
            PutImage(560, 140, 26);
            PutImage(0, 140, 26);
            PutImage(80, 140, 26);
            PutImage(160, 140, 26);
            PutImage(240, 140, 26);
            PutImage(320, 140, 26);
            PutImage(400, 140, 26);
            PutImage(186, 12, 28);
            PutImage(130, 120, -20, 31);
            PutImage(458, 3, 28);
            PutImage(360, 120, -20, 31);
            PutImage(300, 100, -40, 33);
            NewMan(10, 160, 0, DUMMY, 28);
            NewMan(111, 202, 0, DUMMY, 28);
            NewMan(306, 187, 0, DUMMY, 28);
            PutImage(560, 5, 28);
            PutImage(705, 7, 28);
            PutImage(550, 120, -20, 31);
            PutImage(460, 80, -40, 31);
            PutImage(875, 5, 28);
            PutImage(880, 140, 26);
            borderright = shiftx + 960;
            int a = NewMan(50, 160, 0, GIRL1, 101);
            if(a > 0)
                myman = a;
            NewMan(378, 208, 0, GIRL2, 121);
            NewMan(200, 153, -20, SOLDIER1, 131);
            NewMan(170, 203, 0, SOLDIER1, 131);
            NewMan(495, 173, -20, SOLDIER1, 131);
            NewMan(560, 113, -40, SOLDIER1, 131);
            NewMan(640, 160, -20, SOLDIER1, 131);
            NewMan(680, 213, 0, GIRL2, 121);
            NewMan(790, 173, 0, SOLDIER1, 131);
            borderbottom = shifty + 220;
            NewMan(720, 196, 0, DUMMY, 28);
            PutImage(890, 30, -80, 33);
            NewMan(848, 203, 0, DUMMY, 28);
            NewMan(508, 223, 0, DUMMY, 28);
            NewMan(353, 118, -40, GIRL2, 121);
            NewMan(919, 42, -80, BOSS1, 151);
            NewMan(951, 51, -80, BOSS1, 151);
            NewMan(925, 54, -80, SOLDIER1, 131);
        }
        if(stage == 2)
        {
            PaintMap((680 + shiftx) / gridx, (240 + shifty) / gridy, 40, 10, 2);
            PaintMap((680 + shiftx) / gridx, (180 + shifty) / gridy, 40, 10, 2);
            PaintMap((400 + shiftx) / gridx, (240 + shifty) / gridy, 40, 10, 2);
            PutImage(103, 96, 28);
            PaintMap((0 + shiftx) / gridx, (220 + shifty) / gridy, 40, 10, 2);
            PutImage(183, 136, 28);
            PutImage(0, 220, 0, 33);
            PutImage(40, 200, -20, 33);
            PutImage(220, 220, 0, 31);
            PutImage(100, 180, -40, 33);
            PutImage(400, 220, 0, 31);
            PutImage(300, 110, 0, 32);
            PutImage(420, 110, 0, 32);
            PutImage(640, 130, -20, 31);
            PutImage(540, 190, -20, 31);
            PutImage(830, 130, -20, 31);
            PutImage(730, 190, -20, 31);
            PutImage(650, 20, -20, 32);
            PutImage(750, 50, -20, 32);
            NewMan(268, 265, 0, DUMMY, 28);
            NewMan(596, 240, -20, DUMMY, 28);
            NewMan(551, 211, -20, DUMMY, 28);
            NewMan(664, 201, -20, DUMMY, 28);
            NewMan(906, 154, 0, DUMMY, 28);
            borderright = shiftx + 980;
            NewMan(510, 276, 0, GIRL2, 121);
            NewMan(290, 250, 0, SOLDIER1, 131);
            NewMan(890, 206, -20, GIRL2, 121);
            NewMan(730, 190, -20, GIRL2, 121);
            NewMan(780, 216, -20, GIRL2, 121);
            NewMan(580, 230, -20, SOLDIER1, 131);
            int a = NewMan(75, 216, -20, GIRL1, 101);
            if(a > 0)
                myman = a;
            borderbottom = shifty + 320;
            NewMan(940, 156, -20, BOSS2, 141);
        }
        if(stage == 3)
        {
            scrollspeedx = 1;
            PaintMap((1010 + shiftx) / gridx, (230 + shifty) / gridy, 40, 10, 2);
            PaintMap((800 + shiftx) / gridx, (230 + shifty) / gridy, 40, 10, 2);
            PaintMap((0 + shiftx) / gridx, (230 + shifty) / gridy, 40, 10, 2);
            PutImage(60, 230, 25);
            PaintMap((400 + shiftx) / gridx, (230 + shifty) / gridy, 40, 10, 2);
            PutImage(430, 230, 25);
            PutImage(0, 230, 25);
            PutImage(370, 230, 25);
            PutImage(270, 230, 25);
            PutImage(210, 230, 25);
            PutImage(150, 230, 25);
            PutImage(240, 260, 25);
            PutImage(180, 260, 25);
            PutImage(980, 230, 25);
            PutImage(920, 230, 25);
            PutImage(1100, 230, 25);
            PutImage(1040, 230, 25);
            PutImage(1220, 230, 25);
            PutImage(1160, 230, 25);
            PutImage(1090, 260, 25);
            PutImage(1030, 260, 25);
            PutImage(970, 260, 25);
            PutImage(1210, 260, 25);
            PutImage(1150, 260, 25);
            borderright = shiftx + 1300;
            NewMan(460, 252, 0, SOLDIER1, 131);
            NewMan(206, 243, 0, SOLDIER1, 131);
            NewMan(250, 275, 0, GIRL2, 121);
            NewMan(820, 240, 0, BOSS1, 151);
            int a = NewMan(50, 248, 0, GIRL1, 101);
            if(a > 0)
                myman = a;
            borderbottom = shifty + 320;
            PutImage(1340, 220, 25);
            PutImage(1280, 230, 25);
            PutImage(1330, 250, 25);
            PutImage(1270, 260, 25);
            PutImage(590, 230, 25);
            PutImage(530, 230, 25);
            PutImage(650, 230, 25);
            PutImage(580, 260, 25);
            PutImage(640, 260, 25);
            NewMan(630, 253, 0, SOLDIER1, 131);
            NewMan(680, 280, 0, SOLDIER1, 131);
            NewMan(1257, 250, 0, BOSS3, 161);
            NewMan(1171, 258, 0, SOLDIER1, 131);
            NewMan(1213, 276, 0, GIRL2, 121);
            NewMan(1273, 276, 0, GIRL2, 121);
            PutImage(860, 230, 25);
            PutImage(800, 230, 25);
            PutImage(740, 230, 25);
            NewMan(910, 250, 0, BOSS1, 151);
        }
        if(stage == 4)
        {
            PutImage(620, -180, 21);
            PutImage(800, -180, 27);
            PutImage(880, -180, 27);
            PutImage(800, -190, 22);
            PutImage(940, -189, 22);
            PutImage(800, -100, 27);
            PutImage(880, -100, 27);
            borderbottom = shifty + 170;
            PaintMap((0 + shiftx) / gridx, (130 + shifty) / gridy, 40, 10, 2);
            PaintMap((590 + shiftx) / gridx, (130 + shifty) / gridy, 40, 10, 2);
            PutImage(0, 130, 0, 31);
            PutImage(220, 4, 28);
            PutImage(416, -28, 28);
            PutImage(620, -100, 21);
            PutImage(620, -140, 21);
            PutImage(620, -25, 21);
            PutImage(620, -65, 21);
            PutImage(590, -20, 22);
            PutImage(590, -140, 22);
            PutImage(590, -100, 22);
            PutImage(590, -60, 22);
            PutImage(620, 90, 21);
            PutImage(590, 100, 22);
            PaintMap((400 + shiftx) / gridx, (130 + shifty) / gridy, 40, 10, 2);
            PutImage(620, 50, 21);
            PutImage(590, 60, 22);
            PutImage(590, 20, 22);
            PutImage(705, -117, 28);
            PutImage(800, 10, 27);
            PutImage(880, 10, 27);
            PutImage(850, -160, 30);
            PutImage(800, -151, 22);
            PutImage(800, -111, 22);
            PutImage(940, -150, 22);
            PutImage(940, -110, 22);
            NewMan(109, 149, 0, DUMMY, 28);
            NewMan(29, 159, 0, DUMMY, 28);
            bordertop = shifty + -170;
            int a = NewMan(60, 160, 0, GIRL1, 101);

⌨️ 快捷键说明

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