Properties

canTarget: boolean = true

Whether or not targeting is allowed (changed by server). Setting target while this is false will throw an error.

enemies: number[] = []

The gameids of the users targeting the client

engine: Engine

The client's engine

gameid: number

The client's gameid set by the server

keyQueue: Types.Game.Tick.Keypress[] = []

The keys the client has queued to press (allows for pressing keys in the future)

options: ReadyOptions

The raw game config sent by TETR.IO

players: {
    engine: Engine;
    gameid: number;
    name: string;
    queue: Frame[];
    userid: string;
}[] = []

Data on all players in game, including the client

readyData: Ready

The raw game config for all players, including the client's own game config

serverTargets: number[] = []

The targets set by the server

fps: number = 60

The Frames Per Second of the TETR.IO engine

Accessors

  • get forcePauseIGEs(): boolean
  • Force stops the processing of all IGEs (garbage, etc). If left true for too long, the client will be kicked. Use sparingly.

    Returns boolean

  • set forcePauseIGEs(value): void
  • Parameters

    • value: boolean

    Returns void

  • get frame(): number
  • The game's current frame

    Returns number

  • set frame(newFrame): void
  • Parameters

    • newFrame: number

    Returns void

  • get igesPaused(): boolean
  • Whether or not the Game is currently allowed to process IGEs.

    Returns boolean

  • get opponents(): {
        engine: Engine;
        gameid: number;
        name: string;
        queue: Frame[];
        userid: string;
    }[]
  • Returns {
        engine: Engine;
        gameid: number;
        name: string;
        queue: Frame[];
        userid: string;
    }[]

    • use players
  • get pauseIGEs(): boolean
  • Pauses accepting IGEs (garbage events) when the keyQueue has items, when pauseIGEs is set to true.

    Returns boolean

  • set pauseIGEs(value): void
  • Parameters

    • value: boolean

    Returns void

  • get target(): Types.Game.Target
  • The current targeting strategy. Setting a targeting strategy throws error if targeting is not allowed.

    Returns Types.Game.Target

  • set target(t): void
  • Parameters

    Returns void

Methods

  • Parameters

    Returns Engine

  • Kill the game. This is called automatically by the Room class when a game ends/is aborted, you don't need to use this.

    Returns undefined

  • Send raw frames to TETR.IO - Not recommended for normal use.

    Parameters

    Returns void

  • Stops the client's gameplay, when it dies. Does not destroy the game.

    Returns void