本文整理匯總了Java中org.newdawn.slick.AppGameContainer.setTargetFrameRate方法的典型用法代碼示例。如果您正苦於以下問題:Java AppGameContainer.setTargetFrameRate方法的具體用法?Java AppGameContainer.setTargetFrameRate怎麽用?Java AppGameContainer.setTargetFrameRate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.newdawn.slick.AppGameContainer
的用法示例。
在下文中一共展示了AppGameContainer.setTargetFrameRate方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: startGame
import org.newdawn.slick.AppGameContainer; //導入方法依賴的package包/類
/**
* This method starts the game
* @param mode identify the modality of the game
*/
public void startGame(String mode){
try
{
this.mode = mode;
MazeView vl = new MazeView(this, mode);
AppGameContainer app = new AppGameContainer(vl);
app.setDisplayMode(608, 704, false);
if(mode.equals("extreme"))
app.setTargetFrameRate(260);
else
app.setTargetFrameRate(60);
app.setShowFPS(false);
app.start();
}
catch (SlickException e)
{
e.printStackTrace();
}
}
示例2: main
import org.newdawn.slick.AppGameContainer; //導入方法依賴的package包/類
/**
* Entry point to our simple test
*
* @param args The arguments supplied to the test
* @throws SlickException Indicates a failure loading or processing resources
* @throws IOException Indicates a failure loading the font
*/
public static void main(String[] args) throws SlickException, IOException {
Input.disableControllers();
AppGameContainer container = new AppGameContainer(new UnicodeFontTest());
container.setDisplayMode(512, 600, false);
container.setTargetFrameRate(20);
container.start();
}