forked from helloplz/MazeBuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dxiao
committed
Sep 19, 2012
1 parent
5d0644d
commit e64d345
Showing
3 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import org.newdawn.slick.GameContainer; | ||
import org.newdawn.slick.Graphics; | ||
import org.newdawn.slick.SlickException; | ||
import org.newdawn.slick.state.BasicGameState; | ||
import org.newdawn.slick.state.StateBasedGame; | ||
|
||
/** | ||
* The main menu loop. | ||
* | ||
* @author xiao | ||
*/ | ||
public class MainMenuState extends BasicGameState { | ||
|
||
static public final int ID = 0; | ||
|
||
private StateBasedGame game; | ||
|
||
@Override | ||
public void init(GameContainer container, StateBasedGame game) | ||
throws SlickException { | ||
this.game = game; | ||
} | ||
|
||
@Override | ||
public void render(GameContainer container, StateBasedGame game, Graphics g) | ||
throws SlickException { | ||
g.drawString("Hello, Mazebuilder! [MainMenu]", 50, 100); | ||
} | ||
|
||
@Override | ||
public void update(GameContainer container, StateBasedGame game, int delta) | ||
throws SlickException { | ||
} | ||
|
||
@Override | ||
public void mouseClicked(int button, int x, int y, int clickCount) { | ||
game.enterState(GameplayState.ID); | ||
} | ||
|
||
@Override | ||
public int getID() { | ||
// TODO Auto-generated method stub | ||
return 0; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters