Attempts to purchase a perk
Cancels all promises on the api as well as our async channel
Removes all click detectors, except the one on the back button. Useful when regenerating content.
Returns the html element of the state
Should return whether to fade in the game state. This will then apply the right css classes for the fadein.
Should return whether to fade out the game state. This will then apply the right css classes for the fadeout and wait the delay before moving states
Returns if the state has an unload confirmation, this is the "Are you sure you want to leave the page" message.
Should return how many mulliseconds to fade in / out the state. Not recommended to override!
Time in milliseconds to fade out
Should return the states inner html. If not overriden, will create a scrollable container with the content of getMainContentHTML()
Returns the states key
Returns if this state should get paused if it does not have focus
true to pause the updating of the game
Should return whether to show the diamonds in the top right along with the ability to buy them.
true to show it
Should return the theme music for this state
Cleans up all click detectors
Overrides the GameState enter callback to setup required stuff
Internal method to compute the time to fade in / out
time to fade in / out in ms
Overrides the GameState implementation to provide our own html
Overrides the GameState leave callback to cleanup stuff
Internal app pause callback
Internal app resume callback
Internal callback before the state is left. Also is called on page unload
Internal callback from the manager. Do not override!
Internal method to request unlocking a perk
Transfers to a new state
The id of the new state
Should handle a closed multiplayer connection
Should handle a multiplayer packet and return true if the packet was handled and processed
Callback when the app got paused (on android, this means in background)
Callback when the app got resumed (on android, this means in foreground again)
Background tick callback, called while the game is inactiev
Delta time in ms since last tick
Callback before leaving the game state or when the page is unloaded
Callback when leaving the state
Delta time in ms since last render
Called when the screen resized
Shows a notification at the bottom of the screen
Hides the states content and shows an error instead
Shows a language chooser dialog
Shows a restart required dialog
Tracks clicks on a given element and calls the given callback on this state. If you want to call another function wrap it inside a lambda.
The element to track clicks on
The handler to call
Click detector arguments