Commits

Anonymous committed 1072444

Moved setTargetFPS() from main method to Menu init to ensure it's called in an applet too.

Comments (0)

Files changed (2)

src/net/piemaster/shadowquest/MenuState.java

 	 */
 	public void init(GameContainer gc, StateBasedGame sbg) throws SlickException
 	{
+		// Set target frame rate here so it's set in applets too
+		gc.setTargetFrameRate(100);
+		
 		// Load the menu background
 		this.background = new Image("assets/menu/rock-bg.jpg");
 		// Load the subtitle

src/net/piemaster/shadowquest/ShadowQuest.java

 	public ShadowQuest() throws SlickException
 	{
 		super("Shadow Quest");
-
+		
 		this.addState(new MenuState(MENUSTATE));
 		this.addState(new GameplayStateLevelMain(GPSMAIN));
 		this.addState(new GameplayStateLevelDungeon(GPSDUNGEON));
 		AppGameContainer app = new AppGameContainer(new ShadowQuest());
 		// setShowFPS(true), to show frames-per-second.
 		app.setShowFPS(true);
-		app.setTargetFrameRate(100);
 		app.setDisplayMode(SCREENWIDTH, SCREENHEIGHT, false);
 		app.start();
 	}