Initializes the Game.
Name of {@link Canvas} instance.
ID of the FPS counter HTML element.
Heads-up display GameHUD to relay info to the user.
Mocked navigator for unit testing.
Mocked canvas for unit testing.
HTML canvas element reference
Player input from the browser
Current map ID.
Path to current map.
GameHUD instance. Shows info relevant to the player
Game loop, runs the game and controls the timing.
Handles messages from server to game logic.
Player instance.
Renderer instance. Needs to be updated upon window resize.
Current room (contains map and other things, see Room).
Default raycasting resolution. (How many strips/bars are rendered). We've found 500 to be an OK compromise between performance and graphics.
URL of the server. In this case
Getter for canvas reference
Getter for controls instance
Getter for map path
Getter for gamehud instance
Getter for gameloop instance
Getter for PacketToGameLogic instance
Getter for player instance
Getter for renderer instance
Getter for room instance
Checks if the connection to the server is alive.
True if alive, False if failed
Checks for the current map ID obtained from server.
We get the current map ID from PacketToGameLogic and set the map indicated by that ID
Overridden map ID. Only needed for testing (for jasmin environment).
The path to the current map.
Initializes the Renderer with its default settings.
Path to current map.
Reading from file method for testing purposes
Checks if a map was received from server yet.
True if the map was loaded.
path to new map.
Translates map ID to map path. Must be adjusted when adding a new map.
Note that we hard coded this for now. In the future this could be solved with a JSON
map ID
path
Initializes the single Player instance.
Generated using TypeDoc
Main Game class. Initializes the player, map, socket connection and anything else needed for gameplay.