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.

Constructor

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.

Parameters:

GameWidth

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.

GameHeight

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.

InitialState

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

Zoom

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

UpdateFramerate

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

DrawFramerate

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

SkipSplash

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

StartFullscreen

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

Variables

read onlydebugger:FlxDebugger

The debugger overlay object.

filtersEnabled:Bool = true

Enables or disables the filters set via setFilters()

focusLostFramerate:Int = 10

Framerate to use on focus lost. Default = 10.

read onlyrecording:Bool = false

Flag for whether a new recording is being made.

read onlyreplaying:Bool = false

Flag for whether a replay is currently playing.

read onlysoundTray:FlxSoundTray

The sound tray display container (see createSoundTray()).

read onlyticks:Int = 0

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

Methods

setFilters(filters:Array<BitmapFilter>):Void

Sets the filter array to be applied to the game.

Inherited Variables

Inherited Methods