52 lines
1.2 KiB
Java
52 lines
1.2 KiB
Java
package dothack;
|
|
import java.io.IOException;
|
|
|
|
import javax.microedition.lcdui.Display;
|
|
import javax.microedition.midlet.MIDlet;
|
|
|
|
import sillysagiri.Sagiri;
|
|
import sillysagiri.scene.Instruction;
|
|
import sillysagiri.scene.MainMenu;
|
|
import sillysagiri.scene.MainMenu;
|
|
|
|
public class DotHack extends MIDlet implements Runnable {
|
|
public DotHackC game;
|
|
public Sagiri sagiri;
|
|
private Display _display;
|
|
public Thread thread;
|
|
|
|
public void startApp() {
|
|
Global.app = this;
|
|
sagiri = new Sagiri();
|
|
game = new DotHackC(this);
|
|
|
|
_display = Display.getDisplay(this);
|
|
_display.setCurrent(game);
|
|
|
|
thread = new Thread(this);
|
|
thread.setPriority(Thread.MAX_PRIORITY);
|
|
thread.start();
|
|
|
|
sagiri.Set_Scene(new Instruction());
|
|
}
|
|
|
|
public void pauseApp() {}
|
|
|
|
public void destroyApp(boolean paramBoolean) {}
|
|
|
|
public void run() {
|
|
while (true) {
|
|
sagiri.time_begin = System.currentTimeMillis();
|
|
|
|
game.repaint();
|
|
game.serviceRepaints();
|
|
|
|
sagiri.input.Update();
|
|
|
|
try { Thread.sleep(1000/sagiri.fps); }
|
|
catch (Exception e) {}
|
|
|
|
sagiri.time_delta = System.currentTimeMillis() - sagiri.time_begin;
|
|
}
|
|
}
|
|
} |