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

📄 battlechanger.java

📁 j2me 游戏 battle_changer(MOTO)工程。可以参考下。
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
            t_y[4] = height - 40;
            t_x[5] = width + 70;
            t_y[5] = height - 40;
            p_x[0] = width + 50;
            p_y[0] = height / 2 - 30;
            p_x[1] = width + 40;
            p_y[1] = height / 2 - 20;
            p_x[2] = width + 30;
            p_y[2] = height / 2 - 10;
            p_x[3] = width + 20;
            p_y[3] = height / 2;
            p_x[4] = width + 20;
            p_y[4] = height / 2;
            p_x[5] = width + 30;
            p_y[5] = height / 2 + 10;
            p_x[6] = width + 40;
            p_y[6] = height / 2 + 20;
            p_x[7] = width + 50;
            p_y[7] = height / 2 + 30;
            s_x[0] = width + 30;
            s_y[0] = 15;
            s_x[1] = width + 50;
            s_y[1] = 15;
            s_x[2] = width + 70;
            s_y[2] = 15;
            s_x[3] = width + 90;
            s_y[3] = 15;
            s_x[4] = width + 30;
            s_y[4] = height - 37;
            s_x[5] = width + 50;
            s_y[5] = height - 37;
            s_x[6] = width + 70;
            s_y[6] = height - 37;
            s_x[7] = width + 90;
            s_y[7] = height - 37;
            for(int i1 = 0; i1 < 4; i1++)
            {
                eb_x[i1] = -50;
                eb_y[i1] = -50;
            }

            for(int i2 = 0; i2 < 6; i2++)
            {
                t_e_x[i2] = -50;
                t_e_y[i2] = -50;
                turn_enemy[i2] = true;
                m_boss_ebullet[i2] = false;
                mb_e_x[i2] = -50;
                mb_e_y[i2] = -50;
            }

            for(int k2 = 0; k2 < 8; k2++)
                p_p[k2] = 0;

            for(int i3 = 0; i3 < 10; i3++)
            {
                f_x[i3] = width + 30 + i3 * 5 + random_state(width / 3);
                f_y[i3] = random_state(height - 35);
                f_c[i3] = 0;
            }

        }
        if(game_stage == 4)
        {
            bg_x[0] = random_state(width);
            bg_y[0] = height - 20;
            bg_x[1] = random_state(width);
            bg_y[1] = height - 20;
            bg_x[2] = random_state(width);
            bg_y[2] = height - 20;
            bg_x[3] = width + 30;
            bg_y[3] = height / 4 + 15;
            bg_x[4] = width + 50;
            bg_y[4] = height / 4 + 15;
            bg_x[5] = width + 70;
            bg_y[5] = height / 4 + 15;
            bg_x[6] = width + 90;
            bg_y[6] = height / 4 + 15;
            bg_x[7] = width + 110;
            bg_y[7] = height / 4 + 15;
            bg_x[8] = width + 130;
            bg_y[8] = height / 4 + 15;
            bg_x[9] = width + 150;
            bg_y[9] = height / 4 + 15;
            bg_x[10] = width + 170;
            bg_y[10] = height / 4 + 5;
            g_con = 0;
            type = 2;
            spark_count = 0;
            wg_count = 0;
            wpo_p = 0;
            wpo_count = 0;
            btp_c2 = 0;
            be_c = 0;
            red = 5;
            green = 25;
            blue = 150;
            boss_hp = 100;
            b_hp = 250;
            m_boss_x = width + 30;
            m_boss_y = height / 4 - 7;
            boss_x = width + 30;
            boss_y = height - 60;
            mine_x = width + 10;
            mine_y = height - 27;
            wpo_x = width + 10 + random_state(width);
            wpo_y = block_y + 35;
            f_x[0] = width + 10 + random_state(width);
            f_y[0] = block_y + 36;
            f_x[1] = width + 10 + random_state(width);
            f_y[1] = height - 26;
            ground_x = width + 100;
            ground_y = height / 4;
            for(int j1 = 0; j1 < 2; j1++)
            {
                wg_e_x[j1] = -50;
                wg_e_y[j1] = -50;
                tp_tp_x[j1] = -50;
                tp_tp_y[j1] = -50;
                tptp_po[j1] = 0;
                tptp_count[j1] = 0;
                back_count[j1] = 0;
            }

            for(int j2 = 0; j2 < 4; j2++)
            {
                eb_x[j2] = -50;
                eb_y[j2] = -50;
                g_c[j2] = 0;
                h_e_x[j2] = -50;
                h_e_y[j2] = -50;
                h_count[j2] = 0;
                tp_x[j2] = width + 30;
                tp_y[j2] = -50;
                tp_p[j2] = 0;
                btp_p[j2] = 0;
                btp_c[j2] = 0;
                btp_x[j2] = -50;
                btp_y[j2] = -50;
                s_b_count[j2] = 0;
                s_c[j2] = 0;
            }

            for(int l2 = 0; l2 < 6; l2++)
            {
                mb_e_x[l2] = -50;
                mb_e_y[l2] = -50;
                m_boss_ebullet[l2] = false;
            }

            for(int j3 = 0; j3 < 12; j3++)
            {
                e_x[j3] = -50;
                e_y[j3] = -50;
            }

            p_x[0] = width + 20;
            p_y[0] = height / 3 + random_state(height / 3);
            p_x[1] = width + 60;
            p_y[1] = height / 3 + random_state(height / 3);
            p_x[2] = width + 100;
            p_y[2] = height / 3 + random_state(height / 3);
            p_x[3] = width + 140;
            p_y[3] = height / 3 + random_state(height / 3);
            h_x[0] = random_state(width);
            h_y[0] = -20;
            h_x[1] = random_state(width);
            h_y[1] = -40;
            h_x[2] = random_state(width);
            h_y[2] = -60;
            h_x[3] = random_state(width);
            h_y[3] = -80;
            s_x[0] = -50;
            s_y[0] = height / 2 + random_state(height / 4);
            s_x[1] = -100;
            s_y[1] = height / 2 + random_state(height / 4);
            b_x[0] = width + 20;
            b_y[0] = boss_y + 18;
            b_x[1] = width + 40;
            b_y[1] = boss_y + 18;
            b_x[2] = width + 60;
            b_y[2] = boss_y + 18;
            b_x[3] = width + 80;
            b_y[3] = boss_y + 18;
            laser_x = width + 30;
            laser_y = boss_y - 2;
            laser2_x = -50;
            laser2_y = -50;
            t_e_x[0] = width + 30;
            t_e_y[0] = laser_y + 5;
            t_e_x[1] = width + 140;
            t_e_y[1] = laser_y + 5;
        }
        game_state = 3;
        System.gc();
    }

    public void describe()
    {

            if(game_stage == 1)
            {
                g.setColor(red2, green2, blue2);
                g.fillRect(0, 0, width, height / 3);
                for(int i = 0; i < 4; i++)
                {
                    grum_x[i]--;
                    grum_state(i);
                }

                g.setColor(5, 25, 150);
                g.fillRect(0, height / 3, width, height - 23);
                if(bg_x[0] > -20 && bg_x[0] < width + 20)
                {
                    g.drawImage(parent.getImage("bgs0.png"), bg_x[0], bg_y[0], 0x2 | 0x1);
                }
                if(bg_x[1] > -23 && bg_x[1] < width + 23)
                {
                    g.drawImage(parent.getImage("bgs1.png"), bg_x[1], bg_y[1], 0x2 | 0x1);
                }
                if(bg_x[2] > -39 && bg_x[2] < width + 39)
                {
                    g.drawImage(parent.getImage("bgs2.png"), bg_x[2], bg_y[2], 0x2 | 0x1);
                }
                if(ground_x > -20 && ground_x < width + 10 && ground_y > -20 && ground_y < height + 10)
                {
                    g.setColor(210, 170, 105);
                    g.fillRect(ground_x, ground_y - 10, width, height);
                }
                if(laser2_x > -20 && laser2_x < width + 10 && laser2_y > -20 && laser2_y < height + 10)
                {
                    g.setColor(240, 145, 20);
                    g.fillRect(laser2_x - 2, laser2_y - 1, 8, 24);
                    g.setColor(255, 255, 255);
                    g.fillRect(laser2_x, laser2_y, 4, 20);
                }
                for(int j1 = 0; j1 < 4; j1++)
                    if(shoot_boom[j1])
                    {
                        for(int l2 = 0; l2 < 12; l2++)
                            if(e_x[l2] > -20 && e_x[l2] < width + 10 && e_y[l2] > -20 && e_y[l2] < height + 10)
                            {
                                g.setColor(247, 132, 40);
                                g.fillArc(e_x[l2], e_y[l2], 5, 5, 5, 360);
                            }

                    }

                for(int i3 = 0; i3 < 4; i3++)
                    if(h_e_x[i3] > -20 && h_e_x[i3] < width + 10 && h_e_y[i3] > -20 && h_e_y[i3] < height + 10)
                    {
                        g.drawImage(parent.getImage("14.png"), h_e_x[i3], h_e_y[i3], 0x2 | 0x1);
                    }

                for(int i4 = 0; i4 < 4; i4++)
                    if(btp_x[i4] > -20 && btp_x[i4] < width + 10 && btp_y[i4] > -20 && btp_y[i4] < height + 10)
                    {
                        g.drawImage(parent.getImage("15.png"), btp_x[i4] - 5, btp_y[i4], 0x2 | 0x1);
                    }

                for(int i5 = 0; i5 < 4; i5++)
                    if(t_x[i5] > -20 && t_x[i5] < width + 10 && t_y[i5] > -20 && t_y[i5] < height + 10)
                    {
                        g.drawImage(parent.getImage("sea00.png"), t_x[i5], t_y[i5], 0x2 | 0x1);
                    }

                for(int k6 = 0; k6 < 4; k6++)
                    if(p_x[k6] > -20 && p_x[k6] < width + 10 && p_y[k6] > -20 && p_y[k6] < height + 10)
                        if(tp_x[k6] <= -10)
                        {
                            g.drawImage(parent.getImage("sea01.png"), p_x[k6], p_y[k6], 0x2 | 0x1);
                        } else
                        {
                            g.drawImage(parent.getImage("sea02.png"), p_x[k6], p_y[k6], 0x2 | 0x1);
                        }

                for(int j7 = 0; j7 < 4; j7++)
                    if(tp_x[j7] > -20 && tp_x[j7] < width + 10 && tp_y[j7] > -20 && tp_y[j7] < height + 10)
                    {
                        g.drawImage(parent.getImage("15.png"), tp_x[j7] - 5, tp_y[j7], 0x2 | 0x1);
                    }

                for(int i8 = 0; i8 < 4; i8++)
                    if(b_x[i8] > -20 && b_x[i8] < width + 10 && b_y[i8] > -20 && b_y[i8] < height + 10)
                    {
                        g.drawImage(parent.getImage("sea03.png"), b_x[i8], b_y[i8], 0x2 | 0x1);
                    }

                for(int k8 = 0; k8 < 4; k8++)
                    if(h_x[k8] > -20 && h_x[k8] < width + 10 && h_y[k8] > -20 && h_y[k8] < height + 10)
                    {
                        g.drawImage(parent.getImage("sky00.png"), h_x[k8], h_y[k8], 0x2 | 0x1);
                    }

                if(m_boss_x > -30 && m_boss_x < width + 30 && m_boss_y > -20 && m_boss_y < height + 10)
                {
                   g.drawImage(parent.getImage("boss0.png"), m_boss_x, m_boss_y, 0x2 | 0x1);
                }
            }
            if(game_stage == 2)
            {
                g.setColor(red2, green2, blue2);
                g.fillRect(0, 0, width, height);
                g.setColor(211, 180, 120);
                g.fillRect(0, height - 38, width, height - 37);
                g.setColor(182, 133, 72);
                g.fillRect(0, height - 37, width, height - 35);
                g.setColor(172, 116, 53);
                g.fillRect(0, height - 35, width, height - 23);
                if(bg_x[0] > -23 && bg_x[0] < width + 23)
                {
                    g.drawImage(parent.getImage("bgg0.png"), bg_x[0], bg_y[0], 0x2 | 0x1);
                }
                if(bg_x[1] > -23 && bg_x[1] < width + 23)
                {
                    g.drawImage(parent.getImage("bgg1.png"), bg_x[1], bg_y[1], 0x2 | 0x1);
                }
                if(bg_x[2] > -23 && bg_x[2] < width + 23)
                {
                    g.drawImage(parent.getImage("bgg2.png"), bg_x[2], bg_y[2], 0x2 | 0x1);
                }
                for(int j = 0; j < 4; j++)
                {
                    grum_x[j]--;
                    grum_state(j);
                }

                if(laser_x > -20 && laser_x < width + 10 && laser_y > -20 && laser_y < height + 10)
                {
                    g.setColor(240, 145, 20);
                    g.fillRect(laser_x - 2, laser_y - 1, 24, 7);
                    g.setColor(255, 255, 255);
                    g.fillRect(laser_x, laser_y, 20, 4);
                }
                if(jump_eb_x > -5 && jump_eb_x < width + 5 && jump_eb_y > -5 && jump_eb_y < height + 5)
                {
                    g.setColor(247, 132, 40);
                    g.fillArc(jump_eb_x, jump_eb_y, 5, 5, 5, 360);
                }
                for(int k1 = 0; k1 < 5; k1++)
                    if(e_x[k1] > -20 && e_x[k1] < width + 10 && e_y[k1] > -20 && e_y[k1] < height + 10)
                    {
                        g.setColor(247, 132, 40);
                        g.fillArc(e_x[k1], e_y[k1], 5, 5, 5, 360);
                    }

                if(mine_x > -20 && mine_x < width + 10 && mine_y > -20 && mine_y < height + 10)
                {
                    g.setColor(255, 0, 0);
                    g.fillRect(mine_x, mine_y, 10, 4);
                }
                for(int j3 = 0; j3 < 4; j3++)
                    if(h_e_x[j3] > -20 && h_e_x[j3] < width + 10 && h_e_y[j3] > -20 && h_e_y[j3] < height + 10)
                    {
                        g.drawImage(parent.getImage("14.png"), h_e_x[j3], h_e_y[j3], 0x2 | 0x1);
                    }

                if(missile_x > -20 && missile_x < width + 10 && missile_y > -20 && missile_y < height + 10)
                    if(m_p == 1)

⌨️ 快捷键说明

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