Add a thread sleep to keep the game running at speed

Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com>
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2 3 years ago
parent 6ffcf0be3b
commit d5bb96b29a
  1. BIN
      RabiClone_0.0a.zip
  2. BIN
      bin/RabiClone.jar
  3. 9
      src/sig/RabiClone.java

Binary file not shown.

Binary file not shown.

@ -26,7 +26,7 @@ import java.awt.event.KeyEvent;
public class RabiClone { public class RabiClone {
public static final String PROGRAM_NAME = "RabiClone"; public static final String PROGRAM_NAME = "RabiClone";
public static final String BLANK = "\0"; public static String BLANK = "\0";
public static int UPCOUNT = 0; public static int UPCOUNT = 0;
public static Panel p; public static Panel p;
@ -142,7 +142,12 @@ public class RabiClone {
lastReportedTime = System.currentTimeMillis(); lastReportedTime = System.currentTimeMillis();
} }
} }
System.out.print(BLANK); //This is hackish. Removing this slows down the game by about 30%. The timer runs slower. ??? try {
Thread.sleep(4);
} catch (InterruptedException e) {
e.printStackTrace();
}
//System.out.print(BLANK); //This is hackish. Removing this slows down the game by about 30%. The timer runs slower. ???
} }
} }

Loading…
Cancel
Save