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>
This commit is contained in:
parent
6ffcf0be3b
commit
d5bb96b29a
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…
x
Reference in New Issue
Block a user