Interface Player
- All Known Implementing Classes:
- BasicPlayer, EditorPlayer
- public interface Player
- extends GameEntity
This interface will be implemented for any class that should represent a
player in the game.
Method Summary |
int | gameStatus() Returns one of the three constants above telling what the status of the game is. |
Container | getGameStatusPanel(int loc) This method returns a GUI container that shows extra information in your
game. |
EAST_PANEL
public final static int EAST_PANEL
GAME_RUNNING
public final static int GAME_RUNNING
GAME_SUCCESS
public final static int GAME_SUCCESS
NORTH_PANEL
public final static int NORTH_PANEL
PLAYER_DEAD
public final static int PLAYER_DEAD
SOUTH_PANEL
public final static int SOUTH_PANEL
WEST_PANEL
public final static int WEST_PANEL
gameStatus
public int gameStatus()
- Returns one of the three constants above telling what the status of the game is.
getGameStatusPanel
public Container getGameStatusPanel(int loc)
- This method returns a GUI container that shows extra information in your
game. For example, this might be where you display the score to the user.
I recommend that you use a JPanel here, but it should work with any form
of java.awt.Container. This region can be interactive as well if it has
elements in it that handle events. In some games this might be where you
can select options of things like that. It should return null if nothing
is to be displayed. The argument says which area this panel is for. It
should be one of the constants such as NORTH_PANEL;- Parameters:
- loc This integer specifies which side of the display the panel is being requested for.
- Returns: The panel that should go at that location or null if none.