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

📄 yosamabin_n60.java

📁 一款可以运行在模拟器上的j2me的飞机游戏代码,可以在此原型上能够自由开发自己的代码.
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
            stone1x += 25;
        }
        stone1y += 3;
        if(stone2y >= h)
        {
            st2visible = true;
            if(level == 1)
                stone2y = -450;
            else
            if(level == 2)
                stone2y = -10;
            else
            if(level == 3)
                stone2y = -10;
            else
            if(level == 4)
                stone2y = -120;
            stone2x = rd.nextInt() % 100;
            if(stone2x < 0)
                stone2x = -stone2x;
            stone2x += 25;
        }
        stone2y += 4;
        if(stone3y >= h)
        {
            st3visible = true;
            if(level == 3)
                stone3y = -360;
            else
            if(level == 4)
                stone3y = -10;
            stone3x = rd.nextInt() % 100;
            if(stone3x < 0)
                stone3x = -stone3x;
            stone3x += 25;
        }
        stone3y += 5;
        if(st1visible && !down && stone1x + stone[1].getWidth() / 4 > yosamax && stone1x + (3 * stone[1].getWidth()) / 4 < yosamax + stand[1].getWidth() && stone1y > yosamay && stone1y + stone[1].getHeight() < yosamay + stand[1].getHeight() / 3)
        {
            st1visible = false;
            weight += 5;
            pieces++;
            points = 5;
            pointx = stone1x;
            pointy = stone1y - 10;
            pcount = 0;
            playsnd(4);
        }
        if(st2visible && !down && stone2x + stone[2].getWidth() / 4 > yosamax && stone2x + (3 * stone[2].getWidth()) / 4 < yosamax + stand[1].getWidth() && stone2y > yosamay && stone2y + stone[2].getHeight() < yosamay + stand[1].getHeight() / 3)
        {
            st2visible = false;
            weight += 10;
            pieces++;
            points = 10;
            pointx = stone2x;
            pointy = stone2y - 10;
            pcount = 0;
            playsnd(4);
        }
        if(st3visible && !down && stone3x + stone[2].getWidth() / 4 > yosamax && stone3x + (3 * stone[3].getWidth()) / 4 < yosamax + stand[1].getWidth() && stone3y > yosamay && stone3y + stone[3].getHeight() < yosamay + stand[1].getHeight() / 2)
        {
            st3visible = false;
            weight += 15;
            pieces++;
            points = 15;
            pointx = stone3x;
            pointy = stone3y - 10;
            pcount = 0;
            playsnd(4);
        }
        if(st1visible)
        {
            Graphics _tmp = g;
            Graphics _tmp1 = g;
            g.drawImage(stone[1], stone1x, stone1y, 0x10 | 0x4);
        }
        if(st2visible)
        {
            Graphics _tmp2 = g;
            Graphics _tmp3 = g;
            g.drawImage(stone[2], stone2x, stone2y, 0x10 | 0x4);
        }
        if(st3visible)
        {
            Graphics _tmp4 = g;
            Graphics _tmp5 = g;
            g.drawImage(stone[3], stone3x, stone3y, 0x10 | 0x4);
        }
    }

    public void yosamamov(Graphics g, DirectGraphics directgraphics)
    {
        if(up)
        {
            if(janim < 1 || janim == 7)
            {
                if(dir == 1)
                {
                    Graphics _tmp = g;
                    Graphics _tmp1 = g;
                    g.drawImage(jump[1], yosamax, yosamay, 0x10 | 0x4);
                } else
                {
                    Graphics _tmp2 = g;
                    Graphics _tmp3 = g;
                    directgraphics.drawImage(jump[1], yosamax, yosamay, 0x10 | 0x4, 8192);
                }
                jumpx = yosamax;
                jumpy = yosamay - jumpindex[motion][3];
            } else
            if(janim == 1)
            {
                if(dir == 1)
                {
                    Graphics _tmp4 = g;
                    Graphics _tmp5 = g;
                    g.drawImage(jump[2], yosamax - 12, yosamay - jumpindex[motion][1], 0x10 | 0x4);
                    jumpx = yosamax - 12;
                } else
                {
                    Graphics _tmp6 = g;
                    Graphics _tmp7 = g;
                    directgraphics.drawImage(jump[2], yosamax, yosamay - jumpindex[motion][1], 0x10 | 0x4, 8192);
                    jumpx = yosamax;
                }
                jumpy = yosamay - jumpindex[motion][3];
            } else
            if(janim == 2)
            {
                if(dir == 1)
                {
                    Graphics _tmp8 = g;
                    Graphics _tmp9 = g;
                    g.drawImage(jump[3], yosamax - 17, yosamay - jumpindex[motion][2], 0x10 | 0x4);
                    jumpx = yosamax - 17;
                } else
                {
                    Graphics _tmp10 = g;
                    Graphics _tmp11 = g;
                    directgraphics.drawImage(jump[3], yosamax, yosamay - jumpindex[motion][2], 0x10 | 0x4, 8192);
                    jumpx = yosamax;
                }
                jumpy = yosamay - jumpindex[motion][3];
            } else
            if(janim == 3 || janim == 4 || janim == 5)
            {
                if(dir == 1)
                {
                    Graphics _tmp12 = g;
                    Graphics _tmp13 = g;
                    g.drawImage(jump[4], yosamax - 20, yosamay - jumpindex[motion][3], 0x10 | 0x4);
                    jumpx = yosamax - 20;
                } else
                {
                    Graphics _tmp14 = g;
                    Graphics _tmp15 = g;
                    directgraphics.drawImage(jump[4], yosamax, yosamay - jumpindex[motion][3], 0x10 | 0x4, 8192);
                    jumpx = yosamax;
                }
                jumpy = yosamay - jumpindex[motion][3];
            } else
            if(janim == 6)
            {
                if(dir == 1)
                {
                    Graphics _tmp16 = g;
                    Graphics _tmp17 = g;
                    g.drawImage(jump[5], yosamax - 15, yosamay - jumpindex[motion][4], 0x10 | 0x4);
                    jumpx = yosamax - 15;
                } else
                {
                    Graphics _tmp18 = g;
                    Graphics _tmp19 = g;
                    directgraphics.drawImage(jump[5], yosamax, yosamay - jumpindex[motion][4], 0x10 | 0x4, 8192);
                    jumpx = yosamax;
                }
                jumpy = yosamay - jumpindex[motion][3];
            }
            janim++;
            if(janim >= 8)
            {
                up = false;
                janim = 0;
            }
            if(bullet1x > jumpx && bullet1x < jumpx + jump[4].getWidth() && bullet1y > jumpy && bullet1y < jumpy + jump[4].getHeight())
                hit = true;
            if(bullet2x > jumpx && bullet2x < jumpx + jump[4].getWidth() && bullet2y > jumpy && bullet2y < jumpy + jump[4].getHeight())
                hit = true;
            if(parax > jumpx && parax < jumpx + jump[4].getWidth() && paray + para.getHeight() > jumpy && (paray + para.getHeight()) - 18 < jumpy + jump[4].getHeight())
                hit = explosion = true;
        } else
        if(down)
        {
            g.translate(0, 6);
            if(danim < 1 || danim == 10)
            {
                if(dir == 1)
                {
                    Graphics _tmp20 = g;
                    Graphics _tmp21 = g;
                    g.drawImage(jump[1], yosamax, yosamay, 0x10 | 0x4);
                } else
                {
                    Graphics _tmp22 = g;
                    Graphics _tmp23 = g;
                    directgraphics.drawImage(jump[1], yosamax, yosamay, 0x10 | 0x4, 8192);
                }
                duckx = yosamax;
                ducky = yosamay;
            } else
            if(danim == 1)
            {
                if(dir == 1)
                {
                    Graphics _tmp24 = g;
                    Graphics _tmp25 = g;
                    g.drawImage(bend[2], yosamax, yosamay + 2, 0x10 | 0x4);
                    duckx = yosamax;
                } else
                {
                    Graphics _tmp26 = g;
                    Graphics _tmp27 = g;
                    directgraphics.drawImage(bend[2], yosamax - bend[2].getWidth() / 2, yosamay + 2, 0x10 | 0x4, 8192);
                    duckx = yosamax - bend[2].getWidth() / 2;
                }
                ducky = yosamay + 5;
            } else
            if(danim == 2)
            {
                if(dir == 1)
                {
                    Graphics _tmp28 = g;
                    Graphics _tmp29 = g;
                    g.drawImage(bend[3], yosamax + 1, yosamay + 2, 0x10 | 0x4);
                    duckx = yosamax + 1;
                } else
                {
                    Graphics _tmp30 = g;
                    Graphics _tmp31 = g;
                    directgraphics.drawImage(bend[3], yosamax - bend[3].getWidth() / 2 - 1, yosamay + 2, 0x10 | 0x4, 8192);
                    duckx = yosamax - bend[3].getWidth() / 2 - 1;
                }
                ducky = yosamay + 10;
            } else
            if(danim == 3)
            {
                if(dir == 1)
                {
                    Graphics _tmp32 = g;
                    Graphics _tmp33 = g;
                    g.drawImage(bend[4], yosamax - 1, yosamay + 6, 0x10 | 0x4);
                    duckx = yosamax - 1;
                } else
                {
                    Graphics _tmp34 = g;
                    Graphics _tmp35 = g;
                    directgraphics.drawImage(bend[4], yosamax - bend[4].getWidth() / 2 - 1, yosamay + 6, 0x10 | 0x4, 8192);
                    duckx = yosamax - bend[4].getWidth() / 2 - 1;
                }
                ducky = yosamay + 10;
            } else
            if(danim == 4)
            {
                if(dir == 1)
                {
                    Graphics _tmp36 = g;
                    Graphics _tmp37 = g;
                    g.drawImage(bend[5], yosamax + 7, yosamay + 10, 0x10 | 0x4);
                    duckx = yosamax + 7;
                } else
                {
                    Graphics _tmp38 = g;
                    Graphics _tmp39 = g;
                    directgraphics.drawImage(bend[5], yosamax - bend[5].getWidth() / 2 - 7, yosamay + 10, 0x10 | 0x4, 8192);
                    duckx = yosamax - bend[5].getWidth() / 2 - 7;
                }
                ducky = yosamay + 10;
            } else
            if(danim == 5 || danim == 6 || danim == 7)
            {
                if(dir == 1)
                {
                    Graphics _tmp40 = g;
                    Graphics _tmp41 = g;
                    g.drawImage(bend[6], yosamax + 7, yosamay + 15, 0x10 | 0x4);
                    duckx = yosamax + 7;
                } else
                {
                    Graphics _tmp42 = g;
                    Graphics _tmp43 = g;
                    directgraphics.drawImage(bend[6], yosamax - bend[6].getWidth() / 2 - 10, yosamay + 15, 0x10 | 0x4, 8192);
                    duckx = yosamax - bend[6].getWidth() / 2 - 10;
                }
                ducky = yosamay + 20;
            } else
            if(danim == 8)
            {
                if(dir == 1)
                {
                    Graphics _tmp44 = g;
                    Graphics _tmp45 = g;
                    g.drawImage(bend[7], yosamax + 2, yosamay + 5, 0x10 | 0x4);
                    duckx = yosamax + 2;
                } else
                {
                    Graphics _tmp46 = g;
                    Graphics _tmp47 = g;
                    directgraphics.drawImage(bend[7], yosamax - bend[7].getWidth() / 2 - 2, yosamay + 5, 0x10 | 0x4, 8192);
                    duckx = yosamax - bend[7].getWidth() / 2 - 2;
                }
                ducky = yosamay + 15;
            } else
            if(danim == 9)
            {
                if(dir == 1)
                {
                    Graphics _tmp48 = g;
                    Graphics _tmp49 = g;
                    g.drawImage(bend[8], yosamax, yosamay, 0x10 | 0x4);
                } else
                {
                    Graphics _tmp50 = g;
                    Graphics _tmp51 = g;
                    directgraphics.drawImage(bend[8], yosamax, yosamay, 0x10 | 0x4, 8192);
                }
                duckx = yosamax;
                ducky = yosamay - 10;
            }
            danim++;
            if(danim == 11)
            {
                down = false;
                danim = 0;
            }
            g.translate(0, -6);
            if(bullet1x > duckx && bullet1x < duckx + bend[5].getWidth() && bullet1y > ducky && bullet1y < 205)
                hit = true;
            if(bullet2x > duckx && bullet2x < duckx + bend[5].getWidth() && bullet2y > ducky && bullet2y < 205)
                hit = true;
            if(parax > duckx && parax < duckx + bend[5].getWidth() && paray + para.getHeight() > ducky && (paray + para.getHeight()) - 18 < 205)
                hit = explosion = true;
        } else
        if(left)
        {
            dir = 1;
            g.translate(0, 6);
            if(wanim < 1 || wanim == 8)
            {
                Graphics _tmp52 = g;
                Graphics _tmp53 = g;
                g.drawImage(walk[1], yosamax - 4, yosamay, 0x10 | 0x4);
            } else
            if(wanim == 1 || wanim == 7)
            {
                Graphics _tmp54 = g;
                Graphics _tmp55 = g;
                g.drawImage(walk[2], yosamax, yosamay - 1, 0x10 | 0x4);
  

⌨️ 快捷键说明

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