コード例 #1
0
  @Override
  protected void initEngine() {
    super.initEngine();

    myResourceManager = new ResourceManager(this);
    myLevelManager = new LevelManager(this);
    myResourceManager.parse();
    myStates = new HashMap<Integer, VoogaState>();
    myState =
        new VoogaState() {
          private EventManager myEventManager = new EventManager();

          @Override
          public void update(long elapsedTime) {
            return;
          }

          @Override
          public void render(Graphics2D g) {
            return;
          }

          @Override
          public EventManager getEventManager() {
            return myEventManager;
          }
        };
    myStates.put(DEFAULT, myState);
    myStates.put(GAME, myLevelManager);
    // Register keyboard input checking event handler.
    myResourceManager.getKeyMap().registerEventHandler(this);
  }
コード例 #2
0
 /**
  * Use getResourceManager() and ResourceManager#getImageLoader().
  *
  * @return
  */
 public ImageLoader getImageLoader() {
   return myResourceManager.getImageLoader();
 }