Move setHZ() calls to Main.java.
This commit is contained in:
parent
95dee0b409
commit
ddde7ddde3
|
@ -38,10 +38,12 @@ public class Main {
|
||||||
|
|
||||||
//Initialize GameThread
|
//Initialize GameThread
|
||||||
PaintThread paintThread = new PaintThread(gf);
|
PaintThread paintThread = new PaintThread(gf);
|
||||||
|
paintThread.setHz(60); //This may be set depending on the system graphic settings.
|
||||||
paintThread.start();
|
paintThread.start();
|
||||||
|
|
||||||
//Initialize UpdateThread
|
//Initialize UpdateThread
|
||||||
UpdateThread updateThread = new UpdateThread();
|
UpdateThread updateThread = new UpdateThread();
|
||||||
|
updateThread.setHz(100); //This shall remain constant across all systems.
|
||||||
updateThread.start();
|
updateThread.start();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ public class PaintThread extends TimedThread {
|
||||||
public PaintThread(GameFrame gf) {
|
public PaintThread(GameFrame gf) {
|
||||||
this.gf = gf;
|
this.gf = gf;
|
||||||
this.setName("PaintThread");
|
this.setName("PaintThread");
|
||||||
this.setHz(60);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void work() {
|
public void work() {
|
||||||
|
|
|
@ -9,7 +9,6 @@ public class UpdateThread extends TimedThread {
|
||||||
|
|
||||||
public UpdateThread() {
|
public UpdateThread() {
|
||||||
this.setName("UpdateThread");
|
this.setName("UpdateThread");
|
||||||
this.setHz(60);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void work() {
|
public void work() {
|
||||||
|
|
Loading…
Reference in New Issue