Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MPGameoverState

Hierarchy

Index

Constructors

constructor

Methods

attemptReport

  • attemptReport(opponent: any): void
  • Parameters

    • opponent: any

    Returns void

cancelAllAsyncOperations

  • cancelAllAsyncOperations(): void

getDivElement

  • getDivElement(): HTMLElement
  • Returns the html element of the state

    Returns HTMLElement

getHasFadeIn

  • getHasFadeIn(): boolean

getHasFadeOut

  • getHasFadeOut(): boolean
  • 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 boolean

getHasUnloadConfirmation

  • getHasUnloadConfirmation(): boolean
  • Returns if the state has an unload confirmation, this is the "Are you sure you want to leave the page" message.

    Returns boolean

getInOutFadeTime

  • getInOutFadeTime(): 0 | 200
  • Should return how many mulliseconds to fade in / out the state. Not recommended to override!

    Returns 0 | 200

    Time in milliseconds to fade out

getInnerHTML

  • getInnerHTML(): string

getKey

  • getKey(): any
  • Returns the states key

    Returns any

getPauseOnFocusLost

  • getPauseOnFocusLost(): boolean
  • Returns if this state should get paused if it does not have focus

    Returns boolean

    true to pause the updating of the game

getThemeMusic

  • getThemeMusic(): any

internalCleanUpClickDetectors

  • internalCleanUpClickDetectors(): void

internalEnterCallback

  • internalEnterCallback(payload: any, callCallback?: boolean): void
  • Internal callback when entering the state. Do not override!

    Parameters

    • payload: any

      Arbitrary data passed from the state which we are transferring from

    • Default value callCallback: boolean = true

      Whether to call the onEnter callback

    Returns void

internalGetFadeInOutTime

  • internalGetFadeInOutTime(): number
  • Internal method to compute the time to fade in / out

    Returns number

    time to fade in / out in ms

internalGetFullHtml

  • internalGetFullHtml(): string
  • Internal method to get the HTML of the game state.

    Returns string

internalLeaveCallback

  • internalLeaveCallback(): void
  • Internal callback when the state is left. Do not override!

    Returns void

internalOnAppPauseCallback

  • internalOnAppPauseCallback(): void

internalOnAppResumeCallback

  • internalOnAppResumeCallback(): void

internalOnBeforeExitCallback

  • internalOnBeforeExitCallback(): void

internalRegisterCallback

  • internalRegisterCallback(stateManager: any, app: any): void
  • Internal callback from the manager. Do not override!

    Parameters

    • stateManager: any
    • app: any

    Returns void

moveToState

  • moveToState(stateKey: any, payload?: object, skipFadeOut?: boolean): void
  • Transfers to a new state

    Parameters

    • stateKey: any

      The id of the new state

    • Default value payload: object = {}
    • Default value skipFadeOut: boolean = false

    Returns void

mpHandleConnectionClose

  • mpHandleConnectionClose(): void

mpHandlePacket

  • mpHandlePacket(packet: any): boolean

onAppPause

  • onAppPause(): void
  • Callback when the app got paused (on android, this means in background)

    Returns void

onAppResume

  • onAppResume(): void
  • Callback when the app got resumed (on android, this means in foreground again)

    Returns void

onBackButton

  • onBackButton(): void

onBackgroundTick

  • onBackgroundTick(dt: any): void
  • Background tick callback, called while the game is inactiev

    Parameters

    • dt: any

      Delta time in ms since last tick

    Returns void

onBeforeExit

  • onBeforeExit(): void
  • Callback before leaving the game state or when the page is unloaded

    Returns void

onEnter

  • onEnter(payload: any): void
  • Parameters

    • payload: any

    Returns void

onLeave

  • onLeave(): void

onMainMenu

  • onMainMenu(): void
  • Returns void

onRender

  • onRender(dt: any): void
  • Render callback

    Parameters

    • dt: any

      Delta time in ms since last render

    Returns void

onResized

  • onResized(w: any, h: any): void
  • Called when the screen resized

    Parameters

    • w: any

      window/screen width

    • h: any

      window/screen height

    Returns void

showLanguageChooser

  • showLanguageChooser(dialogs: any, buttonSelector?: string): void
  • Shows a language chooser dialog

    Parameters

    • dialogs: any
    • Default value buttonSelector: string = "button.languageChoose"

    Returns void

trackClicks

  • trackClicks(element: any, handler: any, args?: object): void
  • 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.

    Parameters

    • element: any

      The element to track clicks on

    • handler: any

      The handler to call

    • Default value args: object = {}

      Click detector arguments

    Returns void