Home > Game Dev > Slick project stub

Slick project stub

September 29th, 2009 Leave a comment Go to comments

Here’s a stub for quickly creating a project in Slick. It’s the BasicGame structure.

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 GameTest extends BasicGame {

	public GameTest() {
		super("Title Here");
	}

	@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 {

	}

	// Not part of Slick, but handy all the same.
	public void reset(GameContainer gc) throws SlickException {
		init(gc);
	}

	public static void main(String[] args) throws SlickException {
		AppGameContainer app = new AppGameContainer(new GameTest());
		app.setDisplayMode(640, 480, false);
		app.setShowFPS(true);
		app.start();
	}

}
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 GameTest extends BasicGame {

public GameTest() {
super(“Title Here”);
}

@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 {

}

// Not part of Slick, but handy all the same.
public void reset(GameContainer gc) throws SlickException {
init(gc);
}

public static void main(String[] args) throws SlickException {
AppGameContainer app = new AppGameContainer(new GameTest());
app.setDisplayMode(640, 480, false);
app.setShowFPS(true);
app.start();
}

}

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
Categories: Game Dev Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

 

Switch to our mobile site