コード例 #1
0
ファイル: Field.java プロジェクト: kevinychen/catch22-game
 private void setMissions() {
   if (turnIndex == 0) {
     screen.showMessage(24, 40, "YOU NEED " + neededMissions + " MISSIONS");
     missionBuffer = MISSION_BUFFER;
   }
   if ((turnIndex + 3) % MISSION_LENGTH == 0) {
     numMissions++;
     screen.showMessage(
         24, 40, "YOU HAVE " + numMissions, "OUT OF " + neededMissions + " MISSIONS");
     missionBuffer = MISSION_BUFFER;
   }
   if (Math.random() < .001 * Math.pow(.1, neededMissions - numMissions - 3)) {
     neededMissions += 5;
     screen.showMessage(24, 40, "THE NUMBER OF MISSIONS", "HAS BEEN RAISED TO " + neededMissions);
     missionBuffer = MISSION_BUFFER;
   }
 }
コード例 #2
0
ファイル: Field.java プロジェクト: kevinychen/catch22-game
 void crash() {
   crashed = true;
   screen.showMessage(36, 300, "YOU LOSE.");
   Soundtrack.play("explosion.wav");
 }