ClassCore & Lifecycle@public
FlxGame
Headless game controller and atomic state boundary.
ts
export declare class FlxGame implements FlxStateRuntimeConstructors
ts
constructor(gameSizeX: number, gameSizeY: number, initialState: FlxStateConstructor, zoom?: number, gameFramerate?: number, flashFramerate?: number, useSystemCursor?: boolean, inputOptions?: FlxInputManagerOptions, audioBackend?: FlxAudioBackend)Constructs a new instance of the FlxGame class
| Parameter | Type | Description |
|---|---|---|
gameSizeX | number | - |
gameSizeY | number | - |
initialState | FlxStateConstructor | - |
zoom | number | - |
gameFramerate | number | - |
flashFramerate | number | - |
useSystemCursor | boolean | - |
inputOptions | FlxInputManagerOptions | - |
audioBackend | FlxAudioBackend | - |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
audio | readonly | FlxAudioManager | - |
context | readonly | FlxContext | - |
debugChannel | readonly | DebugChannel | Typed event bus for debug consumers. Zero cost when no listeners. |
flashFramerate | readonly | number | - |
forceDebugger | - | boolean | - |
input | readonly | FlxInputManager | - |
interpolationAlpha | readonly | number | - |
log | readonly | FlxLog | Shared log service. Access via FlxG.log. |
state | readonly | FlxState | null | - |
updateFramerate | readonly | number | - |
useSoundHotKeys | - | boolean | - |
useSystemCursor | readonly | boolean | - |
watch | readonly | FlxWatch | Shared watch service. Access via FlxG.watch. |
zoom | readonly | number | - |
Methods
advance()
ts
advance(elapsedSeconds: number): FixedStepAdvanceResultFeeds browser-clock time through the deterministic fixed-step loop.
Parameters:
| Parameter | Type | Description |
|---|---|---|
elapsedSeconds | number | - |
Returns: FixedStepAdvanceResult
destroy()
ts
destroy(): voidReturns: void
requestState()
ts
requestState(state: FlxState): voidParameters:
| Parameter | Type | Description |
|---|---|---|
state | FlxState | - |
Returns: void
resetState()
ts
resetState(): voidReturns: void
step()
ts
step(stepSeconds?: number): voidExecutes one authoritative simulation step.
Parameters:
| Parameter | Type | Description |
|---|---|---|
stepSeconds | number | - |
Returns: void