Exemple #1
0
 public final void beforeLoop() throws Exception {
   final Pangine engine = Pangine.getEngine();
   initBeforeEngine();
   engine.init();
   engine.setIcon(
       "org/pandcorps/res/img/PandcorpsIcon32.png", "org/pandcorps/res/img/PandcorpsIcon16.png");
   init(); // Don't know why this happens after engine.init; can't set window size here; don't know
           // what steps should happen here; adding initBeforeEngine
 }
Exemple #2
0
 public final void start() throws Panception {
   final Pangine engine = Pangine.getEngine();
   try {
     beforeLoop();
     engine.loop();
   } catch (final Exception e) {
     fatal(engine);
     throw new Panception(e);
   } finally {
     destroy(engine);
   }
 }
Exemple #3
0
 private final void destroy(final Pangine engine) {
   try {
     engine.destroy();
   } catch (final Exception e) {
     // e.printStackTrace();
   }
 }
Exemple #4
0
 private final void fatal(final Pangine engine) {
   try {
     engine.exit();
   } catch (final Exception e) {
     // e.printStackTrace();
   }
 }
Exemple #5
0
 protected Panroom getFirstRoom() throws Exception {
   /*
   Games can override this and retrieve the first room however they want.
   They can throw UnsupportedOperationExceptions in getFirstRoomSize and init if they don't want to use them.
   Nothing else will.
   This method allows init to call methods that use Pangame.getCurrentRoom().
   If it's overridden, the game will need to be careful about that.
   */
   final Panroom room = Pangine.getEngine().createRoom(Pantil.vmid(), getFirstRoomSize());
   setCurrentRoomIfNeeded(room);
   init(room);
   return room;
 }
Exemple #6
0
 public final void recreate() throws Exception {
   Pangine.getEngine().recreate();
 }