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

📄 arkanoidcanvas.java

📁 Arkanoid, game for mobile device It containt only source code, not any document related.
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
  public void run() {
    for (Thread thread = Thread.currentThread(); thread == runner; ) {
      try {
        ArkanoidCanvas _tmp = this;
        Thread.sleep(20L);
        try {
          if (LibVer.indexOf("JSCL-1.1.0") != -1) {
            ArkanoidCanvas _tmp1 = this;
            Thread.sleep(30L);
          }
        } catch (Exception exception) {
          ArkanoidCanvas _tmp2 = this;
          Thread.sleep(15L);
        }
        if (Scene == 20 || Scene == 25 || Scene == 30 || Scene == 35) {
          System.gc();
          ArkanoidCanvas _tmp3 = this;
          Thread.sleep(2000L);
        }
        showNotifyFlgCheck();
        repaint();
        serviceRepaints();
      } catch (Exception exception1) {}
    }

  }

  protected synchronized void paint(Graphics g) {
    g.translate(getWidth() - 176 >> 1, getHeight() - 208 >> 1);
    g.setClip(0, 0, 176, 208);
    gpaint();
    g.drawImage(SCbuf, 0, 0, 0x10 | 4);
    if (Scene == 0 || Scene == 5) {
      g.setFont(Font.getFont(32, 1, 16));
      g.setColor(0, 255, 0);
      g.drawString("High-score " + HSc, 88, 135, 0x10 | 1);
      g.setColor(255, 255, 255);
      g.drawString("Options", 5, 190, 0x10 | 4);
      g.drawString("Exit", 140, 190, 0x10 | 4);
    } else
    if (Scene == 40) {
      g.setColor(255, 255, 255);
      g.setFont(Font.getFont(32, 1, 16));
      g.drawString("Congratulations!", 88, 30, 0x10 | 1);
      g.drawString("You are", 88, 50, 0x10 | 1);
      g.drawString("all round clear.", 88, 70, 0x10 | 1);
      g.drawString("Thank you", 88, 90, 0x10 | 1);
      g.drawString("for playing.", 88, 110, 0x10 | 1);
    } else
    if (Scene == 10 || Scene == 15 || Scene == 50 || Scene == 20 || Scene == 25 ||
        Scene == 30 || Scene == 45 || Scene == 35 || Scene == 70) {
      g.setColor(255, 255, 255);
      if (Scene == 30 || Scene == 35) {
        g.setFont(Font.getFont(32, 1, 16));
        g.drawString("Game over", 7, 88, 0x10 | 4);
      } else
      if (Scene == 45) {
        g.setFont(Font.getFont(32, 1, 16));
        g.drawString("Warp!", 24, 88, 0x10 | 4);
      } else
      if (Scene == 15 || Scene == 50) {
        drawInstruction(g);
        Miss_Flag = false;
        RoundClearFlag = false;
      } else
      if (Scene == 20) {
        if (RoundClearFlag) {
          g.setFont(Font.getFont(32, 1, 16));
          g.drawString("Round clear", 6, 88, 0x10 | 4);
        }
      } else
      if (Scene == 25) {
        if (Miss_Flag) {
          g.setFont(Font.getFont(32, 1, 16));
          g.drawString("Ouch!", 32, 88, 0x10 | 4);
        } else {
          g.setFont(Font.getFont(32, 1, 16));
          g.drawString("You missed!", 7, 88, 0x10 | 4);
        }
      }
      g.setFont(Font.getFont(32, 1, 16));
      g.setColor(255, 255, 255);
      g.drawRect(3, 3, 101, 132);
      g.setColor(255, 255, 0);
      g.drawString("Score", 113, 49, 0x10 | 4);
      g.setColor(255, 0, 0);
      g.drawString("High", 113, 4, 0x10 | 4);
      g.drawString("Round ", 113, 107, 0x10 | 4);
      g.drawString("Score", 113, 19, 0x10 | 4);
      if (Sc >= 0xf4236) {
        Sc = 0xf4236;
      }
      String s;
      if (Sc < 10) {
        s = "     " + Sc;
      } else
      if (Sc < 100) {
        s = "    " + Sc;
      } else
      if (Sc < 1000) {
        s = "   " + Sc;
      } else
      if (Sc < 10000) {
        s = "  " + Sc;
      } else
      if (Sc < 0x186a0) {
        s = " " + Sc;
      } else {
        s = "" + Sc;
      }
      g.setFont(Font.getFont(32, 1, 16));
      g.setColor(0, 0, 0);
      g.fillRect(107, 64, 45, 15);
      g.setColor(255, 255, 255);
      g.drawString(s, 107, 65, 0x10 | 4);
      if (HSc <= Sc) {
        HSc = Sc;
      }
      if (HSc < 10) {
        s = "     " + HSc;
      } else
      if (HSc < 100) {
        s = "    " + HSc;
      } else
      if (HSc < 1000) {
        s = "   " + HSc;
      } else
      if (HSc < 10000) {
        s = "  " + HSc;
      } else
      if (HSc < 0x186a0) {
        s = " " + HSc;
      } else {
        s = "" + HSc;
      }
      g.setColor(0, 0, 0);
      g.fillRect(107, 34, 45, 15);
      g.setColor(0, 255, 255);
      g.drawString(s, 107, 34, 0x10 | 4);
      g.setColor(255, 255, 0);
      if (Scene == 30 || Scene == 35) {
        g.drawString("Options", 5, 185, 0x10 | 4);
        g.drawString("Play", 143, 185, 0x10 | 4);
      } else {
        g.drawString("Options", 5, 185, 0x10 | 4);
        g.drawString("Quit", 143, 185, 0x10 | 4);
      }
      byte byte0 = 0;
      if (Vr >= 99) {
        Vr = 99;
      }
      if (Vr >= 10) {
        byte0 = -5;
      }
      g.setColor(0, 0, 0);
      g.fillRect(107, 89, 45, 15);
      g.setColor(255, 255, 255);
      g.drawString("" + Vr, 133 + byte0, 89, 0x10 | 4);
      byte0 = 0;
      if (Rd >= 10) {
        byte0 = -5;
      }
      g.setColor(0, 0, 0);
      g.fillRect(107, 122, 45, 15);
      g.setColor(255, 255, 255);
      g.drawString("" + Rd, 133 + byte0, 122, 0x10 | 4);
    }
  }

  public int GetSound() {
    return Pm;
  }

  public void SetSound() {
    if (Pm == 0) {
      Pm = 1;
    } else
    if (Pm == 1) {
      Pm = 0;
    }
  }

  public void ResetSound() {
    if (Pm == 0) {
      Pm = 1;
    } else
    if (Pm == 1) {
      Pm = 0;
    }
  }

  public boolean GetVibrate() {
    return mVibrate_on;
  }

  public void SetVibrate() {
    mVibrate_on = true;
  }

  public void ResetVibrate() {
    mVibrate_on = false;
  }

  private void Game_Start_Pro() {
  }

  public void gpaint() {
    try {
      keyHandler(AllKeyCode, SCg);
      if (Scene == 0) {
        System.gc();
        drawAllClear(SCg);
        SCg.setFont(Font.getFont(32, 1, 16));
        drawTitle(SCg);
        Scene = 5;
      } else
      if (Scene == 5) {
        if (Dc == 0 || Dc == 5) {
          Dc = 1;
        }
        drawDohcolor7650(SCg);
      } else
      if (Scene == 1000) {
        drawMenu(SCg);
      } else
      if (Scene == 1010) {
        drawRoundSelect(SCg);
      } else
      if (Scene == 1020) {
        drawSetting(SCg);
      } else
      if (Scene == 1030) {
        drawMenuInstruction(SCg);
      } else
      if (Scene == 1040) {
        drawAbout(SCg);
      } else
      if (Scene == 10) {
        System.gc();
        drawAllClear(SCg);
        Doh_Inst = Math.abs(Rnd.nextInt() % 8);
        KeyCount = 0L;
        ini();
        drawScoreTitle(SCg);
        drawScore(SCg, true);
        drawVr(SCg);
        drawRound(SCg);
        drawWall(BGg);
        ArkanoidCanvas _tmp = this;
        SCg.drawImage(BGbuf, 4, 4, 0x10 | 4);
        PlayPhrase(ph[5], 1, 64);
      } else
      if (Scene == 15) {
        drawAllClear(SCg);
        ArkanoidCanvas _tmp1 = this;
        SCg.drawImage(BGbuf, 4, 4, 0x10 | 4);
        drawScoreTitle(SCg);
        drawScore(SCg, true);
        drawVr(SCg);
        drawRound(SCg);
        drawframe(SCg);
        drawLaser(SCg);
        drawThunder(SCg);
        drawItem(SCg);
        ballMove(SCg);
        drawBall(SCg);
        drawVouse(SCg);
        drawBreak(SCg);
        if (Wc == 0 && Scene != 50) {
          RoundClearFlag = true;
          Scene = 20;
          ArkanoidCanvas _tmp2 = this;
          SCg.drawImage(BGbuf, 4, 4, 0x10 | 4);
        }
      } else
      if (Scene == 50) {
        drawAllClear(SCg);
        drawScoreTitle(SCg);
        drawScore(SCg, true);
        drawVr(SCg);
        drawRound(SCg);
        drawDohcolor(BGg);
        ArkanoidCanvas _tmp3 = this;
        SCg.drawImage(BGbuf, 4, 4, 0x10 | 4);
        drawDohLaser(SCg);
        ballMove(SCg);
        drawBall(SCg);
        drawVouse(SCg);
      } else
      if (Scene == 20) {
        drawAllClear(SCg);
        ini();
        drawScoreTitle(SCg);
        drawScore(SCg, true);
        drawVr(SCg);
        if (Rd == 99) {
          All_Clear_Time = System.currentTimeMillis();
          Scene = 40;
          return;
        }
        Rd++;
        TRdv = Rd;
        if (TRd < Rd) {
          TRd = Rd;
        }
        recordJob(true);
        next_item = 0;
        roundDataRead(Rd);
        drawWall(BGg);
        drawRound(SCg);
        ArkanoidCanvas _tmp4 = this;
        SCg.drawImage(BGbuf, 4, 4, 0x10 | 4);
        PlayPhrase(ph[5], 1, 64);
      } else
      if (Scene == 25) {
        drawAllClear(SCg);
        ini();
        drawScoreTitle(SCg);
        drawScore(SCg, true);
        drawVr(SCg);
        drawWall(BGg);
        drawRound(SCg);
        ArkanoidCanvas _tmp5 = this;
        SCg.drawImage(BGbuf, 4, 4, 0x10 | 4);
        PlayPhrase(ph[5], 1, 64);
      } else
      if (Scene == 30) {
        recordJob(true);
        drawAllClear(SCg);
        ini();
        drawScoreTitle(SCg);
        drawScore(SCg, true);
        drawVr(SCg);
        drawWall(BGg);
        drawRound(SCg);
        BGg.setColor(255, 255, 255);
        Scene = 35;
        ArkanoidCanvas _tmp6 = this;
        SCg.drawImage(BGbuf, 4, 4, 0x10 | 4);
        PlayPhrase(ph[3], 1, 64);
      } else
      if (Scene != 35) {
        if (Scene == 45) {
          ArkanoidCanvas _tmp7 = this;
          SCg.drawImage(BGbuf, 4, 4, 0x10 | 4);
          drawVouse(SCg);
          drawBreak(SCg);
          Vxp++;
          if (Vxp == 105) {
            Scene = 20;
          }
        } else
        if (Scene == 40) {
          drawAllClear(SCg);
          SCg.setColor(255, 255, 255);
          if (System.currentTimeMillis() - All_Clear_Time > 7000L) {
            Scene = 0;
            ContinueFlag = false;
          }
        } else
        if (Scene == 90) {
          drawAllClear(SCg);
          SCg.setColor(255, 255, 0);
          SCg.setFont(Font.getFont(32, 1, 16));
          ArkanoidCanvas _tmp8 = this;
          SCg.drawString("Come to", 88, 15, 0x10 | 1);
          ArkanoidCanvas _tmp9 = this;
          SCg.drawString("Club Nokia", 88, 40, 0x10 | 1);
          ArkanoidCanvas _tmp10 = this;
          SCg.drawString("and DL", 88, 65, 0x10 | 1);
          ArkanoidCanvas _tmp11 = this;
          SCg.drawString("the full game !", 88, 90, 0x10 | 1);
          SCg.setFont(Font.getFont(32, 1, 8));
          ArkanoidCanvas _tmp12 = this;
          SCg.drawString("Press key(1)", 88, 115, 0x10 | 1);
        } else
        if (Scene == 70) {
          DLT++;
          if (Dc == 0) {
            Dc = 1;
            PlayPhrase(ph[2], 1, 64);
          }
          drawDohcolor(BGg);
          ArkanoidCanvas _tmp13 = this;
          SCg.drawImage(BGbuf, 4, 4, 0x10 | 4);
          if (DLT == 100) {
            Scene = 20;
          }
        }
      }
      if (Ltm == Pm) {
        ;
      }
    } catch (Exception exception) {}
  }

  private void drawInstruction(Graphics g) {
    g.setColor(0, 0, 0);
    g.fillRect(0, 140, getWidth(), 45);
    g.setFont(Font.getFont(32, 1, 8));
    if (KeyInst == 4L) {
      g.setColor(0, 255, 0);
      if (Vst == 0 && Brf == 1) {
        g.drawString("Escape:", 28, 140, 0x10 | 4);
        g.drawString("Warping to next level", 28, 155, 0x10 | 4);
        g.drawImage(Inst_item[0], 5, 140, 0x10 | 4);
        if (KeyCount == 30L) {
          KeyCount = 0L;
        }
      } else
      if (Vst == 2) {
        g.drawString("Split-up:", 28, 140, 0x10 | 4);
        g.drawString("Ball Multiplies 8x", 28, 155, 0x10 | 4);
        g.drawImage(Inst_item[2], 5, 140, 0x10 | 4);
        if (KeyCount == 30L) {
          KeyCount = 0L;
        }
      } else
      if (Vst == 1) {
        g.drawString("Catch & Fire:", 28, 140, 0x10 | 4);
        g.drawString("Ball attaches to VAUS", 28, 155, 0x10 | 4);
        g.drawImage(Inst_item[1], 5, 140, 0x10 | 4);
        if (KeyCount == 30L) {
          KeyCount = 0L;
        }
      } else
      if (Vst == 3) {
        g.drawString("Enlarge:", 28, 140, 0x10 | 4);
        g.drawString("Enlarge VAUS", 28, 155, 0x10 | 4);
        g.drawImage(Inst_item[3], 5, 140, 0x10 | 4);
        if (KeyCount == 30L) {
          KeyCount = 0L;
        }
      } else
      if (Vst == 4) {
        if (laser_flg == 0) {
          g.drawString("Laser:", 28, 140, 0x10 | 4);
          g.drawString("Catch 1 for laser.", 28, 155, 0x10 | 4);
          g.drawImage(Inst_item[4], 5, 140, 0x10 | 4);
          KeyCount++;
          if (KeyCount == 30L) {
            KeyCount = 0L;
            laser_flg = 1;
          }
        } else
        if (laser_flg == 1) {
          g.drawString("Catch 2 for wave laser.", 28, 140, 0x10 | 4);
          g.drawString("Press <2> for a second to", 28, 155, 0x10 | 4);
          g.drawString("charge & fire wave laser.", 28, 170, 0x10 | 4);
          g.drawImage(Inst_item[4], 5, 140, 0x10 | 4);
          KeyCount++;
          if (KeyCount == 30L) {
            KeyCount = 0L;
            laser_flg = 0;
          }
        }
      } else
      if (Vst == 5) {
        g.drawString("Mega-ball:", 28, 140, 0x10 | 4);
        g.drawString("Ball penetrates blocks", 28, 155, 0x10 | 4);
        g.drawString("without bouncing", 28, 170, 0x10 | 4);
        g.drawImage(Inst_item[5], 5, 140, 0x10 | 4);
      } else
      if (Vst == 6) {
        g.drawString("Life:", 28, 140, 0x10 | 4);
        g.drawString("Extra life", 28, 155, 0x10 | 4);
        g.drawImage(Inst_item[6], 5, 140, 0x10 | 4);
      } else
      if (Vst == 7) {
        g.drawString("Slow down:", 30, 140, 0x10 | 4);
        g.drawString("Decrease speed of ball", 30, 155, 0x10 | 4);
        g.drawImage(Inst_item[7], 5, 140, 0x10 | 4);
      } else
      if (Vst == 8 && Tn != 0) {
        g.drawString("Thunder:", 30, 140, 0x10 | 4);
        g.drawString("Set one safety barrier", 30, 155, 0x10 | 4);
        g.drawImage(Inst_item[8], 5, 140, 0x10 | 4);
      }
    } else {
      KeyCount++;
      g.setColor(0, 255, 255);
      if (Scene == 15) {
        if (KeyInst == 0L) {
          g.drawString("Left and 4:", getWidth() >> 1, 140, 0x10 | 1);
          g.drawString("Move VAUS to left", getWidth() >> 1, 155, 0x10 | 1);
          if (KeyCount == 30L) 

⌨️ 快捷键说明

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