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

📄 battle_on_the_river_kwai_n60.java

📁 J2ME War game Thank you very much.
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
////                    g.drawString("GAME OVER", w / 2, h / 2 + 60,
////                                 Graphics.TOP | Graphics.HCENTER);
//                    g.drawString("Score: " + score, w / 2, h / 2,
//                                 Graphics.TOP | Graphics.HCENTER);
                }
                break;

            case 0:

                g.setColor(255, 255, 255);
                g.fillRect(0, 0, w, h);

                //count++;

                fire = 0;
                g.drawImage(loading, w / 2, h / 2,
                            Graphics.VCENTER | Graphics.HCENTER);
                g.setColor(255, 0, 0);
                g.fillRect(38, 196, tindex * 4 - 8, 8);
                g.setColor(0, 0, 0);
                g.drawRect(37, 195, 102, 9);
                if (tindex < Trp.length) {
                    try {
                        Trp[tindex] = Image.createImage(Tinm[tindex]);
                    } catch (Exception e) {}

                    //	System.out.println("tindex: "+tindex+"  Trp["+tindex+"]"+Trp[tindex]+"  Tinm["+tindex+"]"+Tinm[tindex]);
                } else if (tindex >= Trp.length) {
                    initpara();
                    inittext();
                    //	intsnd(3);
                    tindex = 0;
                    a = 1;
                    j = 0;
                    try {
                        itr = Image.createImage("/intro.png");
                        btns2 = Image.createImage("/btns2.png");
                        btns3 = Image.createImage("/btns3.png");
                        intsnd(3);

                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
                tindex++;

                break;

            case 1: //intro
                if (snd[0].getState() != Sound.SOUND_PLAYING && checkPause == false &&
                    sound == 0 && a != 15) {
                    playsnd(0); //System.out.println("insou= "+insou);
                }
                introcnt++;
                g.setColor(0, 0, 0);
                g.fillRect(0, 0, w, h);
                g.setColor(255, 255, 255);

                drawbg(g, IN_Game);
                g.drawImage(itr, 0, 0, Graphics.TOP | Graphics.LEFT);

//                if (introcnt % 2 == 0) {
                g.setColor(0x000000);
                g.fillRect(1, h - 15, w - 1, 12);
                g.drawImage(joystick, w / 2, h - 5,
                            Graphics.BOTTOM | Graphics.HCENTER);

//                }
                j = 5;
                break;

            case 2: //option
                try {
                    snd[0].stop();
                } catch (Exception e) {}
                g.setColor(0, 0, 0);
                g.fillRect(0, 0, w, h);
                g.setColor(255, 255, 255);

//                drawbg(g, false);


                g.drawImage(bbg4, 0, 0, Graphics.TOP | Graphics.LEFT);
                for (int i = 0; i < menu.length; i++) {
                    if (i == menuSelectIndex) {
                        g.drawImage(btns3, w / 2, h / 6 - 8 + (i * 25),
                                    Graphics.TOP | Graphics.HCENTER);
                        g.setFont(Font.getFont(Font.FACE_SYSTEM,
                                               Font.STYLE_BOLD, Font.SIZE_SMALL));
                        g.setColor(255, 255, 255);
                        g.drawString(menu[i], w / 2, h / 6 - 3 + (i * 25),
                                     Graphics.TOP | Graphics.HCENTER);
                    } else {
                        g.drawImage(btns2, w / 2, h / 6 - 8 + (i * 25),
                                    Graphics.TOP | Graphics.HCENTER);
                        g.setFont(Font.getFont(Font.FACE_SYSTEM,
                                               Font.STYLE_BOLD, Font.SIZE_SMALL));
                        g.setColor(60, 60, 60);
                        g.drawString(menu[i], w / 2, h / 6 - 3 + (i * 25),
                                     Graphics.TOP | Graphics.HCENTER);
                    }
                }

                /*
                       g.setColor(0,0,0);
                       g.fillRect(20,h-14-2,w-40+5,15);
                       if(gc%3!=0)
                       {
                 drtrng(dg,20,h-14,6,90);
                 drtrng(dg,w-20,h-14,6,270);
                   }
                      Menu.drawHmenu(g,menu,w/2,h-14,no);

                      if(expcnt==0)
                       {
                 playsnd(2);
                 expcnt=ranno(30,40);
                       }
                       else if(expcnt>0)
                       {
                 if(gc%3==0)expcnt--;
                       }
                 */
                break;

            case 3:
                System.out.println("3");
                g.drawImage(bbg2, 0, 0, Graphics.TOP | Graphics.LEFT);
                g.setColor(0, 0, 0);
                g.fillRect(0, 0, w, h);
                drawbg(g, false);
                g.setColor(0x00FF00);
                g.drawRoundRect(5, 25, w - 10, h - 40, 25, 25);

                g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD,
                                       Font.SIZE_MEDIUM));
                g.drawString(menu[a - 2], w / 2, start - 5,
                             Graphics.TOP | Graphics.HCENTER);
                g.setColor(0xFFFFFF);
                g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD,
                                       Font.SIZE_SMALL));
                nkpr = Menu.drawtext(g, Game2play, tmp[0], w, h, start, endp,
                                     fs, x1, y1, tdif, lpp);
                g.setClip(0, 0, w, h);
                if (nkpr != 1) {
                    if (nkpr != 2) {
                        drtrng(dg, w / 2, start + fs + 3, 6, 0);
                    }
                    if (nkpr != 8) {
                        drtrng(dg, w / 2, init + endp + 1, 6, 180);
                    }
                }
                break;

            case 4: //Instructions
                g.drawImage(bbg2, 0, 0, Graphics.TOP | Graphics.LEFT);
                g.setColor(0, 0, 0);
                g.fillRect(0, 0, w, h);
                g.setColor(255, 255, 255);
                drawbg(g, false);

                g.setColor(0x00FF00);
                g.drawRoundRect(5, 28, w - 10, h - 40, 25, 25);
                g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD,
                                       Font.SIZE_MEDIUM));
                g.drawString(menu[1], w / 2, start - 5,
                             Graphics.TOP | Graphics.HCENTER);
                g.setColor(0xFFFFFF);
                g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD,
                                       Font.SIZE_SMALL));
                nkpr = Menu.drawtext(g, How2play, tmp[1], w, h, start, endp, fs,
                                     x1, y1, tdif, lpp);
                g.setClip(0, 0, w, h);
                if (nkpr != 1) {
                    if (nkpr != 2) {
                        drtrng(dg, w / 2, start + fs + 3, 6, 0);
                        g.setColor(0x000000);
                        g.fillRect(1, h - 11, w - 1, 12);
                        g.drawImage(joystick, w / 2, h - 1,
                                    Graphics.BOTTOM | Graphics.HCENTER);

                    }
                    if (nkpr != 8) {
                        drtrng(dg, w / 2, init + endp + 1, 6, 180);
                    }
                }
                break;

            case 5:
                g.drawImage(bbg2, 0, 0, Graphics.TOP | Graphics.LEFT);
                g.setColor(0, 0, 0);
                g.fillRect(0, 0, w, h);
                drawbg(g, false);

                /*
                            g.setColor(0xFFFF00);
                            g.drawRoundRect(5,28,w-10,h-40,25,25);
                 g.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_BOLD,Font.SIZE_MEDIUM));
                 g.drawString(menu[a-1],w/2,start, Graphics.TOP|Graphics.HCENTER);

                 g.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_BOLD,Font.SIZE_SMALL));
                   g.drawString("Name",25,40, Graphics.TOP|Graphics.LEFT);
                 g.drawString("Score",160,40, Graphics.TOP|Graphics.RIGHT);
                 g.drawString("",w/2,h-12, Graphics.TOP|Graphics.HCENTER);

                   g.setColor(0xFFFFFF);
                 g.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_BOLD,Font.SIZE_SMALL));

                       for(int k=0;k<scr.length-1;k++)
                       {
                 g.drawString(""+(k+1),10,(k*14)+60,Graphics.TOP|Graphics.LEFT);
                 g.drawString(""+str[k],25,(k*14)+60,Graphics.TOP|Graphics.LEFT);
                 g.drawString(""+scr[k],160,(k*14)+60,Graphics.TOP|Graphics.RIGHT);
                       }*/
                g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD,
                                       Font.SIZE_SMALL));

//                g.setColor(0x000000);
//                g.drawString("Top Score", w / 2 + 1, 28,
//                             Graphics.TOP | Graphics.HCENTER);
                g.setColor(0x00FF00);
                g.drawString("Top Score", w / 2, 30,
                             Graphics.TOP | Graphics.HCENTER);
                g.setColor(0xffffff);
                g.drawRoundRect(10, 45, w - 20, h - 63, 30, 25);
                int strHeight = 80;
                g.drawString("TOP 5", 20, 55, Graphics.TOP | Graphics.LEFT);
                g.drawString("Name", 55, 55, Graphics.TOP | Graphics.LEFT);
                g.drawString("Score", 125, 55, Graphics.TOP | Graphics.LEFT);
                for (int k = 0; k < scr.length - 1; k++) {
                    g.drawLine(10, strHeight - 3, w - 10, strHeight - 3);

                    g.drawString("" + (k + 1), 20, strHeight + 3,
                                 Graphics.TOP | Graphics.LEFT);
                    g.drawString("" + str[k], 55, strHeight + 3,
                                 Graphics.TOP | Graphics.LEFT);
                    g.drawString("" + scr[k], 125, strHeight + 3,
                                 Graphics.TOP | Graphics.LEFT);
                    strHeight += 22;
                }
                g.setColor(0x000000);
                g.fillRect(1, h - 15, w - 1, 12);
                g.drawImage(joystick, w / 2, h - 5,
                            Graphics.BOTTOM | Graphics.HCENTER);

                break;

            case 6:
                g.drawImage(bbg2, 0, 0, Graphics.TOP | Graphics.LEFT);

                g.setColor(0x00FF00);
                g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD,
                                       Font.SIZE_MEDIUM));
                g.drawString("Global Scorecard", w / 2, 25,
                             Graphics.TOP | Graphics.HCENTER);
                g.setColor(255, 255, 255);
                g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN,
                                       Font.SIZE_MEDIUM));
                g.drawString("Retrieval of Global Scorecard", w / 2, h / 2 - 20,
                             Graphics.TOP | Graphics.HCENTER);
                g.drawString("will depend on carrier networks", w / 2,
                             h / 2 - 5, Graphics.TOP | Graphics.HCENTER);
                g.drawString("and handset compatibility", w / 2, h / 2 + 10,
                             Graphics.TOP | Graphics.HCENTER);
                g.drawString("Back", w - 2, h - 13,
                             Graphics.TOP | Graphics.RIGHT);
                g.drawString("Continue", 2, h - 13,
                             Graphics.TOP | Graphics.LEFT);

                break;

            case 7:
                g.drawImage(bbg2, 0, 0, Graphics.TOP | Graphics.LEFT);
                g.setColor(0x00FF00);
                g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD,
                                       Font.SIZE_MEDIUM));
                g.drawString("About Fugumobile", w / 2, 30,
                             Graphics.TOP | Graphics.HCENTER);
                g.setColor(255, 255, 255);
                g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN,
                                       Font.SIZE_MEDIUM));
                g.drawString("Did you know that Fugu", w / 2, h / 2 - 50,
                             Graphics.TOP | Graphics.HCENTER);
                g.drawString("is a fatal delicacy?", w / 2, h / 2 - 35,
                             Graphics.TOP | Graphics.HCENTER);
                g.drawString("Now experience the same", w / 2, h / 2 - 20,
                             Graphics.TOP | Graphics.HCENTER);
                g.drawString("heart pounding but yet", w / 2, h / 2 - 5,
                             Graphics.TOP | Graphics.HCENTER);
                g.drawString("deliciously prepared", w / 2, h / 2 + 10,
                             Graphics.TOP | Graphics.HCENTER);
                g.drawString("menu of games @", w / 2, h / 2 + 25,
                             Graphics.TOP | Graphics.HCENTER);
                g.drawString("www.fugumobile.com.", w / 2, h / 2 + 40,
                             Graphics.TOP | Graphics.HCENTER);
                g.drawString("What r u waiting for?", w / 2, h / 2 + 55,
                             Graphics.TOP | Graphics.HCENTER);
                g.drawString("Get Hooked!", w / 2, h / 2 + 70,
                             Graphics.TOP | Graphics.HCENTER);
                g.setColor(0x000000);
                g.fillRect(1, h - 15, w - 1, 12);
                g.drawImage(joystick, w / 2, h - 5,
                            Graphics.BOTTOM | Graphics.HCENTER);

                break;
            case 8:
                try {
                    for (int i = 0; i <= 4; i++) {
                        snd[i].stop();
                    }
                } catch (Exception e) {}
                destroyApp(false);
                notifyDestroyed();
                break;

            case 9:
                menu[0] = "Continue";

                //isContinue=true;
                a = 2;

                //gameState=0;
                display.setCurrent(intro);
                break;

            case 10:
                gamePaint = 0;

⌨️ 快捷键说明

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