Skip to content

Instantly share code, notes, and snippets.

@jxcodetw
Last active August 29, 2015 14:01
Show Gist options
  • Save jxcodetw/007cd259a4610f3a6e79 to your computer and use it in GitHub Desktop.
Save jxcodetw/007cd259a4610f3a6e79 to your computer and use it in GitHub Desktop.
just a demo
import java.util.logging.Level;
import java.util.logging.Logger;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;
public class MyGame extends BasicGame
{
public Opera(String title)
{
super(title);
}
public static void main(String[] args)
{
try
{
AppGameContainer game;
game = new AppGameContainer(new MyGame("MyGame"));
game.setTargetFrameRate(60);
game.setVSync(true);
game.setUpdateOnlyWhenVisible(true);
game.setDisplayMode(800, 800, false);
game.start();
}
catch (SlickException ex)
{
Logger.getLogger(MyGame.class.getName()).log(Level.SEVERE, null, ex);
}
}
@Override
public void init(GameContainer gc) throws SlickException
{}
@Override
public void render(GameContainer gc, Graphics g) throws SlickException
{}
@Override
public void update(GameContainer gc, int delta) throws SlickException
{}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment