- 在你的Package中創建新的Class
- 一個叫Play,另一個叫Menu
- Run Program會有一個黑色的畫面
The Code:Play.class
package
javagame;
import
org.newdawn.slick.*;
import
org.newdawn.slick.state.*;
public
class
Play extends
BasicGameState
{
public
Play(int
State)
{
}
public
void
init(GameContainer gc,StateBasedGame sbg) throws
SlickException
{
}
public
void
render(GameContainer gc,StateBasedGame sbg, Graphics g) throws
SlickException
{
}
public
void
update(GameContainer gc,StateBasedGame sbg, int
delta) throws
SlickException
{
}
public
int
getID()
{
return
1;
}
}
The Code:Menu.class
package
javagame;
import
org.newdawn.slick.*;
import
org.newdawn.slick.state.*;
public
class
Menu extends
BasicGameState
{
public
Menu(int
State)
{
}
public
void
init(GameContainer gc,StateBasedGame sbg) throws
SlickException
{
}
public
void
render(GameContainer gc,StateBasedGame sbg, Graphics g) throws
SlickException
{
}
public
void
update(GameContainer gc,StateBasedGame sbg, int
delta) throws
SlickException
{
}
public
int
getID()
{
return
0;
}
}



沒有留言:
張貼留言