Skip to content

ReplayPlayback beta ​

Interface of @v12-engine/client

ts
export interface ReplayPlayback

A replay being played: held and let go, faster or slower, and taken to any moment of it. What the bar over a replay shows (replayScene)

Members ​

apart ​

ts
readonly apart: Accessor<number | null>;

Where the game played back came apart from the one recorded, in seconds from its start: its hash differed there (the rules changed since), and from then it is the game these rules make. Null while it has not

catchingUp ​

ts
readonly catchingUp: Accessor<number | null>;

How far it has come to the moment asked, 0 to 1, while there is more than half a second of the game still to run to it (a seek, a fast speed); null while it keeps up

dispose ​

ts
dispose(): void;

Stops following the replay: with the game that plays it

length ​

ts
readonly length: number;

How long the replay is, in seconds of the game

playing ​

ts
readonly playing: Accessor<boolean>;

Whether it is running, or held

seconds ​

ts
readonly seconds: Accessor<number>;

Where it is, in seconds from its start

seek ​

ts
seek(seconds: number): void;

Goes to a moment of it, in seconds from its start, ahead or back, in the same game: run a slice at a time, the screen going on meanwhile (catchingUp); back from the last checkpoint before it

setSpeed ​

ts
setSpeed(speed: number): void;

Sets the speed of the replay, one of speeds

speed ​

ts
readonly speed: Accessor<number>;

How fast it runs when it does

speeds ​

ts
readonly speeds: readonly number[];

The speeds there are to pick from (REPLAY_SPEEDS)

step ​

ts
step(): void;

Holds it, and goes on by one tick of the game

toggle ​

ts
toggle(): void;

Holds it, or lets it go on