@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); }
/** * Use getResourceManager() and ResourceManager#getImageLoader(). * * @return */ public ImageLoader getImageLoader() { return myResourceManager.getImageLoader(); }