Constructor Summary
Public Constructor | ||
public |
Load all the different windows/UI portions on the index page relevant for use in the game, set the zoom factor, update the orientation and then load the login screen |
Member Summary
Public Members | ||
public |
An instance of the DOM $('#toggle-about') element |
|
public |
An instance of the DOM $('body') element |
|
public |
An instance of the DOM $('#border') element |
|
public |
An instance of the DOM $('#cancelButton') element |
|
public |
An instance of the DOM $('#canvasLayers') element |
|
public |
Configuration for the client application loaded from ./data/config.json |
|
public |
An instance of the DOM $('#container') element |
|
public |
An instance of the DOM $('#play') element |
|
public |
An instance of the DOM $('#toggle-credits') element |
|
public |
An instance of the DOM $('.error.message') element |
|
public |
An instance of Game class |
|
public |
An instance of the DOM $('#toggle-git') element |
|
public |
An instance of the DOM $('#guest') element |
|
public |
Used to determine if the player is logging in as a guest or not |
|
public |
The height of the player's browser window |
|
public |
An instance of the DOM $('#helpButton') element |
|
public |
An instance of the DOM $('#modal') element |
|
public |
An instance of the DOM $('.loader') element |
|
public |
An instance of the DOM $('.loader.message') element |
|
public |
Used to figure out whether or not to show the login screen |
|
public |
An instance of the DOM $('#loginButton') element |
|
public |
An instance of the DOM $('#loginNameInput') and $('#loginPasswordInput') element |
|
public |
An instance of the DOM $('#no') element |
|
public |
The orientation of the player's device |
|
public |
The field whose range is being updated |
|
public |
Callback function when this class is done loading |
|
public |
An instance of the DOM $('#newCharacter') element |
|
public |
Register fields |
|
public |
An instance of the DOM $('#rememberMe') element |
|
public |
An instance of the DOM $('#respawn') element |
|
public |
Used to display loading status messages |
|
public |
The width of the player's browser window |
|
public |
An instance of the DOM $(window) element |
|
public |
An instance of the DOM $('#content') element |
|
public |
An instance of the DOM $('#yes') element |
|
public |
Zoom percentage from 0 to 1 |
Method Summary
Public Methods | ||
public |
canvasClickEventListener(event: Object): Boolean Handles clicks on the HTML5 canvas |
|
public |
Clean up any current form validation errors on the active form's input fields |
|
public |
displayScreen(origin: String, destination: String): boolean Changes from one screen to another |
|
public |
displayScroll(content: String) Display the given screen |
|
public |
fadeMenu() Fades the menu |
|
public |
Return the active form from the top wrapper's class name |
|
public |
Returns the orientation of the device the user is on |
|
public |
Figures out the current scale factor to use for assets |
|
public |
Returns the zoom factor |
|
public |
Checks to see if the window has a web worker |
|
public |
Returns true if this player is playing as a guest |
|
public |
Check if the player is using a phone |
|
public |
Returns true if the join form is displayed |
|
public |
Check if the player is using a tablet |
|
public |
keydownEventListener(event: Object): Boolean Handles key down presses |
|
public |
keyupEventListener(event: Object): Boolean Handles key up presses |
|
public |
Add click listeners for the different parts of the UI |
|
public |
mousemoveEventListener(event: Object): boolean Handles mouse movements |
|
public |
The callback function when this app class is ready and done loading |
|
public |
resize() Call the game's resizer function |
|
public |
Revert the loader message to it's default state of 'Connecting to server...' |
|
public |
Set this input field as having an error |
|
public |
sendStatus(message: String) Display a status message to the client |
|
public |
setGame(game: *) Set the client to use a new instance of the game |
|
public |
showMenu() Shows the menu |
|
public |
toggleLogin(toggle: Boolean) Toggle displaying the login form |
|
public |
toggleTyping(state: String) Toggle the read only attribute on the login fields and form registration fields |
|
public |
updateLoader(message: String) Update the loader to show a specific message |
|
public |
Updates the orientation of the application to match the orientation of the device the player is using |
|
public |
updateRange(field: *) Update the range of and object using a linear gradient on the background color |
|
public |
verifyEmail(email: String): Boolean Verify this is a valid email address |
|
public |
Verify the active form |
|
public |
Verify the input fields on the join form |
|
public |
Check to see if the player has entered a valid username and password before attempting to login |
|
public |
Dismissing the welcome screen when the application has finished loading |
|
public |
zoom() Handles zooming the container to scale the game to fit porportionally with the player's window size |
Private Methods | ||
private |
Switch to the load character screen |
|
private |
Try to connect and login to the game |
|
private |
Try to login as a guest |
|
private |
Tells the game to toggle remembering this player, if true will store player information in local storage |
|
private |
Tells the game to respawn the player |
Public Constructors
public constructor() source
Load all the different windows/UI portions on the index page relevant for use in the game, set the zoom factor, update the orientation and then load the login screen
Test:
Public Members
public config: Object source
Configuration for the client application loaded from ./data/config.json
Public Methods
public canvasClickEventListener(event: Object): Boolean source
Handles clicks on the HTML5 canvas
Params:
Name | Type | Attribute | Description |
event | Object | click event |
public cleanErrors() source
Clean up any current form validation errors on the active form's input fields
public displayScreen(origin: String, destination: String): boolean source
Changes from one screen to another
public displayScroll(content: String) source
Display the given screen
Params:
Name | Type | Attribute | Description |
content | String | the screen to display |
public keydownEventListener(event: Object): Boolean source
Handles key down presses
Params:
Name | Type | Attribute | Description |
event | Object | keypress event |
public keyupEventListener(event: Object): Boolean source
Handles key up presses
Params:
Name | Type | Attribute | Description |
event | Object | keypress event |
public mousemoveEventListener(event: Object): boolean source
Handles mouse movements
Params:
Name | Type | Attribute | Description |
event | Object | mouse event |
public onReady(callback: Function) source
The callback function when this app class is ready and done loading
Params:
Name | Type | Attribute | Description |
callback | Function | the callback function when this application class is done loading |
public revertLoader() source
Revert the loader message to it's default state of 'Connecting to server...'
public sendStatus(message: String) source
Display a status message to the client
Params:
Name | Type | Attribute | Description |
message | String | the message |
public setGame(game: *) source
Set the client to use a new instance of the game
Params:
Name | Type | Attribute | Description |
game | * |
public toggleLogin(toggle: Boolean) source
Toggle displaying the login form
Params:
Name | Type | Attribute | Description |
toggle | Boolean | true to hide, false to show |
public toggleTyping(state: String) source
Toggle the read only attribute on the login fields and form registration fields
Params:
Name | Type | Attribute | Description |
state | String | the state to update the fields to |
public updateLoader(message: String) source
Update the loader to show a specific message
Params:
Name | Type | Attribute | Description |
message | String | the loader message to display |
public updateOrientation() source
Updates the orientation of the application to match the orientation of the device the player is using
public updateRange(field: *) source
Update the range of and object using a linear gradient on the background color
Params:
Name | Type | Attribute | Description |
field | * |
public verifyEmail(email: String): Boolean source
Verify this is a valid email address
Params:
Name | Type | Attribute | Description |
String | player's email address |
public verifyLoginForm(): Boolean source
Check to see if the player has entered a valid username and password before attempting to login
public welcomeContinue(): boolean source
Dismissing the welcome screen when the application has finished loading
public zoom() source
Handles zooming the container to scale the game to fit porportionally with the player's window size