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)

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

Data on the opponents in game

options: ReadyOptions

The raw game config sent by TETR.IO

readyData: Ready

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

serverTargets: number[] = []

The targets set by the server

stats: {
    piecesPlaced: number;
} = ...

Game stats

use engine.stats instead

fps: number = 60

The Frames Per Second of the TETR.IO engine

Accessors

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

    Returns number

  • set frame(newFrame): void
  • Parameters

    • newFrame: number

    Returns void

  • get target(): Types.Game.Target
  • The current targeting strategy

    Returns Types.Game.Target

  • set target(t): void
  • Set the current targeting strategy, throws error if targeting is not allowed

    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 recommendedfor normal use.

    Parameters

    Returns void