public class NavigationScreen extends AbstractScreen
Modifier and Type | Field and Description |
---|---|
private float |
ANIM_TIME
The amount of ticks it takes for the black to fade in and out
|
private float |
animTimer
The current animation frame of the fading in/out
|
private RoomArrow |
arrow
The Sprite that is to draw the arrows on the screen by doors
|
private com.badlogic.gdx.graphics.g2d.Sprite |
BLACK_BACKGROUND
The black sprite that is used to fade in/out
|
private com.badlogic.gdx.graphics.OrthographicCamera |
camera
The camera to render the map to
|
private boolean |
changeMap
This boolean determines whether the map needs to be updated in the next render loop
|
ConversationManagement |
convMngt
This is the main ConversationManager that controls the conversation mechanic
|
private java.util.List<NPC> |
currentNPCS
This is the list of NPCs in the current Room
|
private boolean |
fadeToBlack
This boolean determines whether the black is fading in or out
|
private com.badlogic.gdx.maps.tiled.TiledMap |
map
This is the current map that is being shown
|
private com.badlogic.gdx.InputMultiplexer |
multiplexer
The input multiplexer for the game
|
private boolean |
pause
This stores whether the game is paused or not
|
PlayerController |
playerController
The controller that listens for key inputs
|
private RoomTag |
roomTag
This is the room name tag that is to be rendered to the screen
|
private boolean |
roomTransition
This determines whether the player is currently changing rooms, it will fade out to black, change
the room, then fade back in.
|
SpeechboxManager |
speechboxMngr
This is the SpeechboxManager for the main game
|
private com.badlogic.gdx.graphics.g2d.SpriteBatch |
spriteBatch |
private StatusBar |
statusBar
This is the StatusBar that shows at the bottom
|
private OrthogonalTiledMapRendererWithPeople |
tiledMapRenderer
This is the map renderer that also renders Sprites
|
private com.badlogic.gdx.utils.viewport.Viewport |
viewport |
game
Constructor and Description |
---|
NavigationScreen(GameMain game)
Initialises the navigation screen
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
This is to be called when you want to dispose of all data
|
void |
finishRoomTransition()
This is called when the room transition animation has completed so the necessary variables
can be returned to their normal values
|
java.util.List<NPC> |
getNPCs()
This method gets the list of current NPCs in the current room
|
void |
hide()
This method is called when the user hides the window
|
void |
initialiseRoomChange()
This is called when the player decides to move to another room
|
void |
pause()
This is called when the focus is lost on the window
|
void |
render(float delta)
Called when the screen should render itself.
|
void |
resize(int width,
int height)
This is called when the window is resized
|
void |
resume()
This method is called when the window is brought back into focus
|
void |
setRoomTag(RoomTag tag)
This method sets the RoomTag to the parameter which is then rendered next render loop
|
void |
show()
This is ran when the navigation screen becomes the visible screen in GameMain
|
void |
update()
This method is called once a game tick
|
void |
updateTiledMapRenderer()
This lets the tiledMapRenderer know that on the next render it should reload the current room from the player.
|
private void |
updateTransition()
This method is called once a game tick to update the room transition animation
|
public PlayerController playerController
public SpeechboxManager speechboxMngr
public ConversationManagement convMngt
private boolean fadeToBlack
private com.badlogic.gdx.maps.tiled.TiledMap map
private boolean changeMap
private java.util.List<NPC> currentNPCS
private OrthogonalTiledMapRendererWithPeople tiledMapRenderer
private com.badlogic.gdx.graphics.OrthographicCamera camera
private com.badlogic.gdx.utils.viewport.Viewport viewport
private com.badlogic.gdx.graphics.g2d.SpriteBatch spriteBatch
private com.badlogic.gdx.InputMultiplexer multiplexer
private boolean pause
private StatusBar statusBar
private boolean roomTransition
private float ANIM_TIME
private com.badlogic.gdx.graphics.g2d.Sprite BLACK_BACKGROUND
private float animTimer
private RoomArrow arrow
private RoomTag roomTag
If it is null then there is no tag to display
public NavigationScreen(GameMain game)
game
- - The main game instancepublic void show()
show
in interface com.badlogic.gdx.Screen
show
in class AbstractScreen
public void update()
update
in class AbstractScreen
private void updateTransition()
public void initialiseRoomChange()
public void finishRoomTransition()
public void render(float delta)
render
in interface com.badlogic.gdx.Screen
render
in class AbstractScreen
delta
- The time in seconds since the last render.public void resize(int width, int height)
resize
in interface com.badlogic.gdx.Screen
resize
in class AbstractScreen
width
- - The new widthheight
- - The new heightpublic void pause()
pause
in interface com.badlogic.gdx.Screen
pause
in class AbstractScreen
public void resume()
resume
in interface com.badlogic.gdx.Screen
resume
in class AbstractScreen
public void hide()
hide
in interface com.badlogic.gdx.Screen
hide
in class AbstractScreen
public void dispose()
dispose
in interface com.badlogic.gdx.Screen
dispose
in class AbstractScreen
public void updateTiledMapRenderer()
public void setRoomTag(RoomTag tag)
tag
- - The RoomTag to be renderedpublic java.util.List<NPC> getNPCs()