Package pelletQuest.main

Source Code of pelletQuest.main.GameLoadState

package pelletQuest.main;

import pelletQuest.database.World;
import org.newdawn.slick.*;
import org.newdawn.slick.state.*;
import org.newdawn.slick.state.transition.FadeInTransition;
import org.newdawn.slick.state.transition.FadeOutTransition;
import org.newdawn.slick.util.xml.*;

public class GameLoadState extends BasicGameState {
 
  public static final int ID = 5;
  public int getID() { return ID; }
 
  public void init(GameContainer container, StateBasedGame game) throws SlickException {
  }
 
  public void enter(GameContainer container, StateBasedGame game) throws SlickException {
    XMLParser parser = new XMLParser();
    XMLElement root = parser.parse("data/newgameData.xml");
    World.loadWorldData(root);
  }
 
    public void leave (GameContainer container, StateBasedGame game) {
    }

  public void render(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
  }

  public void update(GameContainer container, StateBasedGame game, int deltathrows SlickException {
    game.enterState(PlayState.ID, new FadeOutTransition(), new FadeInTransition());
  }

}
TOP

Related Classes of pelletQuest.main.GameLoadState

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.