FlxGame is the heart of all Flixel games, and contains a bunch of basic game loops and things. It is a long and sloppy file that you shouldn't have to worry about too much! It is basically only used to create your game object in the first place, after that FlxG and FlxState have all the useful stuff you actually need.


@:value({ StartFullscreen : false, SkipSplash : false, DrawFramerate : 60, UpdateFramerate : 60, Zoom : 1, GameHeight : 0, GameWidth : 0 })new(GameWidth:Int = 0, GameHeight:Int = 0, ?InitialState:Class<FlxState>, Zoom:Float = 1, UpdateFramerate:Int = 60, DrawFramerate:Int = 60, SkipSplash:Bool = false, StartFullscreen:Bool = false)

Instantiate a new game object.



The width of your game in game pixels, not necessarily final display pixels (see Zoom). If equal to 0, the window width specified in the Project.xml is used.


The height of your game in game pixels, not necessarily final display pixels (see Zoom). If equal to 0, the window height specified in the Project.xml is used.


The class name of the state you want to create and switch to first (e.g. MenuState).


The default level of zoom for the game's cameras (e.g. 2 = all pixels are now drawn at 2x).


How frequently the game should update (default is 60 times per second).


Sets the actual display / draw framerate for the game (default is 60 times per second).


Whether you want to skip the flixel splash screen with FLX_NO_DEBUG.


Whether to start the game in fullscreen mode (desktop targets only).


read onlydebugger:FlxDebugger

The debugger overlay object.

@:value(true)filtersEnabled:Bool = true

Enables or disables the filters set via setFilters().

@:value(10)focusLostFramerate:Int = 10

Framerate to use on focus lost. Default is 10.

@:value(false)@:allow(flixel.system.frontEnds.VCRFrontEnd)read onlyrecording:Bool = false

Flag for whether a new recording is being made.

@:value(false)@:allow(flixel.system.frontEnds.VCRFrontEnd)read onlyreplaying:Bool = false

Flag for whether a replay is currently playing.

read onlysoundTray:FlxSoundTray

The sound tray display container.

@:value(0)read onlyticks:Int = 0

Time in milliseconds that has passed (amount of "ticks" passed) since the game has started.



Sets the filter array to be applied to the game.

Inherited Variables

Inherited Methods

Defined by Sprite

@:value({ bounds : null, lockCenter : false })startDrag(lockCenter:Bool = false, ?bounds:Null<Rectangle>):Void

@:value({ bounds : null, lockCenter : false })startTouchDrag(touchPointID:Int, lockCenter:Bool = false, ?bounds:Null<Rectangle>):Void


Defined by DisplayObjectContainer

Defined by InteractiveObject


Defined by DisplayObject




@:value({ shapeFlag : false })hitTestPoint(x:Float, y:Float, shapeFlag:Bool = false):Bool


Defined by EventDispatcher

@:value({ useWeakReference : false, priority : 0, useCapture : false })addEventListener<T>(type:EventType<T>, listener:T ‑> Void, useCapture:Bool = false, priority:Int = 0, useWeakReference:Bool = false):Void

@:value({ useCapture : false })removeEventListener<T>(type:EventType<T>, listener:T ‑> Void, useCapture:Bool = false):Void