mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-08 12:51:51 +09:00
added sources for Slick
Former-commit-id: 1647fa32ef6894bd7db44f741f07c2f4dcdf9054 Former-commit-id: 0e5810dcfbe1fd59b13e7cabe9f1e93c5542da2d
This commit is contained in:
48
lib/slick-source/org/newdawn/slick/tests/StateBasedTest.java
Normal file
48
lib/slick-source/org/newdawn/slick/tests/StateBasedTest.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package org.newdawn.slick.tests;
|
||||
|
||||
import org.newdawn.slick.AppGameContainer;
|
||||
import org.newdawn.slick.GameContainer;
|
||||
import org.newdawn.slick.SlickException;
|
||||
import org.newdawn.slick.state.StateBasedGame;
|
||||
import org.newdawn.slick.tests.states.TestState1;
|
||||
import org.newdawn.slick.tests.states.TestState2;
|
||||
import org.newdawn.slick.tests.states.TestState3;
|
||||
|
||||
/**
|
||||
* A test for the multi-state based functionality
|
||||
*
|
||||
* @author kevin
|
||||
*/
|
||||
public class StateBasedTest extends StateBasedGame {
|
||||
|
||||
/**
|
||||
* Create a new test
|
||||
*/
|
||||
public StateBasedTest() {
|
||||
super("State Based Test");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.newdawn.slick.state.StateBasedGame#initStatesList(org.newdawn.slick.GameContainer)
|
||||
*/
|
||||
public void initStatesList(GameContainer container) {
|
||||
addState(new TestState1());
|
||||
addState(new TestState2());
|
||||
addState(new TestState3());
|
||||
}
|
||||
|
||||
/**
|
||||
* Entry point to our test
|
||||
*
|
||||
* @param argv The arguments to pass into the test
|
||||
*/
|
||||
public static void main(String[] argv) {
|
||||
try {
|
||||
AppGameContainer container = new AppGameContainer(new StateBasedTest());
|
||||
container.setDisplayMode(800,600,false);
|
||||
container.start();
|
||||
} catch (SlickException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user