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

📄 yosamabin_n60.java

📁 一款可以运行在模拟器上的j2me的飞机游戏代码,可以在此原型上能够自由开发自己的代码.
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
                if(YosamaBin_N60.score > scr[0] || YosamaBin_N60.score > scr[1] || YosamaBin_N60.score > scr[2] || YosamaBin_N60.score > scr[3] || YosamaBin_N60.score > scr[4])
                {
                    n1 = new Entername();
                    display.setCurrent(n1);
                } else
                {
                    YosamaBin_N60.a = 2;
                }
                break;
            }
        }

        public void KeyFire()
        {
            if(YosamaBin_N60.a == 1)
                YosamaBin_N60.a = 2;
            else
            if(YosamaBin_N60.a == 2)
            {
                if(YosamaBin_N60.dn == 0)
                {
                    if(YosamaBin_N60.gameend == 1)
                    {
                        PlayAgain();
                        YosamaBin_N60.game = 1;
                        YosamaBin_N60.gameend = 0;
                    }
                    checkPause = false;
                    up = down = left = right = false;
                    try
                    {
                        YosamaBin_N60.snd[0].stop();
                    }
                    catch(Exception exception) { }
                    YosamaBin_N60.a = 20;
                    display.setCurrent(obj);
                } else
                if(YosamaBin_N60.dn == 3)
                {
                    menu[3] = menu[3] != "Sound(on)" ? "Sound(on)" : "Sound(off)";
                    sound = !sound;
                    YosamaBin_N60.a = 2;
                } else
                if(YosamaBin_N60.dn == menu.length - 1)
                {
                    destroyApp(false);
                    notifyDestroyed();
                } else
                {
                    YosamaBin_N60.a = YosamaBin_N60.dn + 2;
                }
            } else
            if(YosamaBin_N60.a == 15)
            {
                if(YosamaBin_N60.dn1 == 0)
                {
                    up = down = left = right = false;
                    YosamaBin_N60.a = 20;
                    display.setCurrent(obj);
                } else
                if(YosamaBin_N60.dn1 == 1)
                {
                    PlayAgain();
                    YosamaBin_N60.gameend = 0;
                    YosamaBin_N60.game = 1;
                    checkPause = false;
                    YosamaBin_N60.a = 20;
                    display.setCurrent(obj);
                } else
                if(YosamaBin_N60.dn1 == 2)
                    YosamaBin_N60.a = 2;
                else
                if(YosamaBin_N60.dn1 == 3)
                {
                    destroyApp(false);
                    notifyDestroyed();
                }
            } else
            if(YosamaBin_N60.a == 3 || YosamaBin_N60.a == 4 || YosamaBin_N60.a == 6 || YosamaBin_N60.a == 8)
                YosamaBin_N60.a = 2;
        }

        public Intro()
        {
            YosamaBin_N60.w = getWidth();
            YosamaBin_N60.h = getHeight();
        }
    }


    Display display;
    Intro intro;
    GameCanvas obj;
    SubmitPoints subPts;
    ShowScore shwScr;
    FieldMover mover;
    Timer timer;
    public boolean checkPause;
    public boolean yes;
    public boolean sound;
    public static byte count;
    public static byte gamePaint;
    public static byte game;
    public static byte gameend;
    public static byte add;
    public static int a;
    public static int w;
    public static int h;
    public static int score;
    public static int dn;
    public static int dn1;
    public static int menuanim;
    public static int icount;
    public static int level;
    public static int i;
    public String menu[] = {
        "Start2play", "Game2play", "How2play", "Sound(on)", "Top Score", "Hall of Fame", "About", "Exit"
    };
    public String menu1[] = {
        "Continue2play", "New Game", "Main Menu", "Exit"
    };
    public String game2play[] = {
        "Yosama Bin’s laden in trouble as", "his world’s crumbling. The armed", "forces have united against him", "and are adamant to take Yosama", "Bin down!! But Yosama Bin ", "believes that there’s still some", "hope left. He wants to collect ", "the falling pieces of his ", "precious caves and rebuild his", "empire someday. So go on,", 
        "help Yosama Bin gather rubble ", "and avoid trouble!"
    };
    public String how2play[] = {
        "Make Yosama Bin stand under the ", "falling rubble to collect it.", "Press 4 or LEFT to move Yosama", "Bin left", "Press 6 or RIGHT to move Yosama", "Bin right", "Press 2 or UP to make Yosama Bin", "jump", "Press 8 or DOWN to make Yosama", "Bin duck", 
        "Tips: Collect more points for the", "larger pieces of rubble. The more", "rubble Yosama Bin collects, the", "more he is laden with weight.", "Thus, his reflexes slow down."
    };
    public String about[] = {
        "Copyright \251 Mobile2win Ltd.", "For any enquiries, send an", "email to support@mobile2win.com", "Visit us at www.mobile2win.com"
    };
    private static Player snd[] = new Player[6];
    public InputStream istream[];
    String sndnm[] = {
        "/intro.mid", "/bgtrack.mid", "/explode.wav", "/gunshot.wav", "/collect.mid", "/yosama_hit.mid"
    };
    String sndty[] = {
        "audio/midi", "audio/midi", "audio/x-wav", "audio/x-wav", "audio/midi", "audio/midi"
    };
    String store;
    String temp1;
    String name1;
    String str[] = {
        "A", "B", "C", "D", "E", "F"
    };
    int scr[] = {
        0, 0, 0, 0, 0, 0
    };
    public int temp;
    public int xch;
    public Entername n1;
    public TextField name;
    public int ianim;
    public int yosamax;
    public int yosamay;
    public int sanim;
    public int janim;
    public int danim;
    public int wanim;
    public int fireanim;
    public int stone1x;
    public int stone1y;
    public int stone2x;
    public int stone2y;
    public int stone3x;
    public int stone3y;
    public int k;
    public int dropsanim;
    public int weight;
    public int pieces;
    public int motion;
    public int gcounter;
    public int man1x;
    public int man1y;
    public int man2x;
    public int man2y;
    public int bullet1x;
    public int bullet1y;
    public int bullet2x;
    public int bullet2y;
    public int wait1;
    public int wait2;
    public int textscr;
    public int dside;
    public int gap;
    public int jumpx;
    public int jumpy;
    public int duckx;
    public int ducky;
    public int dindex;
    public int dir;
    public int hitcount;
    public int lives;
    public int parax;
    public int paray;
    public int side;
    public int pboundry;
    public int pdir;
    public int fixedx;
    public int fixedy;
    public int pointx;
    public int pointy;
    public int points;
    public int pcount;
    public int jumpindex[][] = {
        {
            0, 0, 0, 0, 0
        }, {
            0, 0, 0, 0, 0
        }, {
            0, 10, 30, 20, 5
        }, {
            0, 15, 35, 25, 10
        }, {
            0, 20, 40, 30, 15
        }
    };
    public boolean left;
    public boolean right;
    public boolean up;
    public boolean down;
    public boolean fire;
    public boolean go;
    public boolean st1visible;
    public boolean st2visible;
    public boolean st3visible;
    public boolean m1visible;
    public boolean m2visible;
    public boolean hit;
    public boolean levelchanged;
    public boolean maround;
    public boolean paravisible;
    public boolean explosion;
    public boolean won;
    public Image arrowl;
    public Image arrowr;
    public Image arrowu;
    public Image arrowd;
    public Image imintro;
    public Image intro1;
    public Image intro2;
    public Image introhand1;
    public Image introhand2;
    public Image introhand3;
    public Image over;
    public Image bg;
    public Image immenu;
    public Image imhit;
    public Image stand[];
    public Image standbr[];
    public Image jump[];
    public Image stone[];
    public Image walk[];
    public Image sol[];
    public Image bend[];
    public Image exp[];
    public Image drops[];
    public Image para;
    public Image imscore;
    public Image loading;
    Random rd;

    public YosamaBin_N60()
    {
        mover = new FieldMover();
        timer = new Timer();
        sound = true;
        istream = new InputStream[6];
        n1 = new Entername();
        System.out.println(sound);
        intro = new Intro();
        obj = new GameCanvas();
        display = Display.getDisplay(this);
    }

    public void introanim(Graphics g)
    {
        Graphics _tmp = g;
        Graphics _tmp1 = g;
        g.drawImage(imintro, 0, 0, 0x10 | 0x4);
        if(ianim < 5)
        {
            Graphics _tmp2 = g;
            Graphics _tmp3 = g;
            g.drawImage(intro1, 46, 12, 0x10 | 0x4);
            Graphics _tmp4 = g;
            Graphics _tmp5 = g;
            g.drawImage(introhand1, 35 - ianim * 2, 94 - ianim * 3, 0x10 | 0x4);
        } else
        if(ianim >= 5 && ianim < 10)
        {
            Graphics _tmp6 = g;
            Graphics _tmp7 = g;
            g.drawImage(intro1, 46, 12, 0x10 | 0x4);
            Graphics _tmp8 = g;
            Graphics _tmp9 = g;
            g.drawImage(introhand3, 5, 16, 0x10 | 0x4);
        } else
        if(ianim >= 10 && ianim < 22)
        {
            if(ianim % 4 < 2)
            {
                Graphics _tmp10 = g;
                Graphics _tmp11 = g;
                g.drawImage(intro1, 46, 7, 0x10 | 0x4);
                Graphics _tmp12 = g;
                Graphics _tmp13 = g;
                g.drawImage(introhand3, 5, 16, 0x10 | 0x4);
            } else
            {
                Graphics _tmp14 = g;
                Graphics _tmp15 = g;
                g.drawImage(intro1, 46, 12, 0x10 | 0x4);
                Graphics _tmp16 = g;
                Graphics _tmp17 = g;
                g.drawImage(introhand3, 5, 16, 0x10 | 0x4);
            }
        } else
        if(ianim >= 24 && ianim < 28)
        {
            Graphics _tmp18 = g;
            Graphics _tmp19 = g;
            g.drawImage(intro1, 46, 12, 0x10 | 0x4);
            Graphics _tmp20 = g;
            Graphics _tmp21 = g;
            g.drawImage(intro2, 46, 12, 0x10 | 0x4);
            Graphics _tmp22 = g;
            Graphics _tmp23 = g;
            g.drawImage(introhand3, 5, 16, 0x10 | 0x4);
        } else
        {
            Graphics _tmp24 = g;
            Graphics _tmp25 = g;
            g.drawImage(intro1, 46, 12, 0x10 | 0x4);
            Graphics _tmp26 = g;
            Graphics _tmp27 = g;
            g.drawImage(introhand3, 5, 16, 0x10 | 0x4);
        }
        Graphics _tmp28 = g;
        Graphics _tmp29 = g;
        g.drawImage(introhand2, 109, 80, 0x10 | 0x4);
        ianim++;
    }

    public void drawstones(Graphics g)
    {
        if(stone1y >= h)
        {
            st1visible = true;
            if(level == 1)
                stone1y = -10;
            else
            if(level == 2)
                stone1y = -100;
            else
            if(level == 3)
                stone1y = -450;
            stone1x = rd.nextInt() % 100;
            if(stone1x < 0)
                stone1x = -stone1x;

⌨️ 快捷键说明

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