The main gameplay state.

Static variables

staticSONG:SongData

Current song data in PlayState.

staticboyfriend:Boyfriend

The current player character.

@:value(0)staticcampaignScore:Int = 0

Total score over your current run in Story Mode.

staticcampaignTitle:String

Title of current week in Story Mode.

@:value(BF)staticcharacterPlayingAs:CharacterPlayingAs = BF

Current character you are playing as stored as an Int.

Values:

0 = bf

1 = opponent

-1 = both

@:value(false)staticchartingMode:Bool = false

Is the player charting?

@:value("")staticcurStage:String = ""

The current stage in PlayState.

staticdad:Character

Your current opponent.

staticenemyStrums:FlxTypedGroup<StrumNote>

FlxTypedGroup of all current enemy strums.

staticgf:Character

The current character in the middle of the 3 main characters.

@:value("")staticgroupWeek:String = ""

Current group of weeks you are playing from.

@:value(null)staticinstance:PlayState = null

Current instance of PlayState.

@:value(false)staticisStoryMode:Bool = false

Bool for whether we are currently in Story Mode.

@:value(true)staticloadChartEvents:Bool = true

Whether the game will or will not load events from the chart's events.json file. (Disabled while charting as the events are already loaded)

@:value(false)staticplayCutsceneLmao:Bool = false

@:value(false)staticplayCutsceneOnPauseLmao:Bool = false

@:value(false)staticplayCutscenes:Bool = false

staticplayerStrums:FlxTypedGroup<StrumNote>

FlxTypedGroup of all current player strums.

staticprevCamFollow:FlxObject

Copy of camFollow used for transitioning between songs smoother.

@:value(0)staticpreviousScrollSpeed:Float = 0

Variable that stores the original scroll speed before being divided by songMultiplier.

Usage: ChartingState

@:value(1)staticsongMultiplier:Float = 1

Current song multiplier. (Should be minimum 0.25)

@:value(0)staticstartOnTime:Float = 0

@:value("NORMAL")staticstoryDifficultyStr:String = "NORMAL"

String representation of the current Story Mode difficulty.

@:value([])staticstoryPlaylist:Array<String> = []

Array of all the songs that you are going to play next in Story Mode as String.

@:value(0)staticstoryWeek:Int = 0

Current Story Mode week as an Int.

(Generally unused / deprecated).

staticstrumLineNotes:FlxTypedGroup<StrumNote>

FlxTypedGroup of all current strums (enemy strums are first).

Static methods

Constructor

new(?TransIn:TransitionData, ?TransOut:TransitionData)

Variables

@:value(100.0)accuracy:Float = 100.0

Current accuracy for the player (0 - 100).

@:value(new FlxText(0, 0, 0, "bruh", 24))accuracyText:FlxText = new FlxText(0, 0, 0, "bruh", 24)

@:value([])addedVocals:Array<String> = []

@:value("")altAnim:String = ""

Current alt animation for any characters that may be using it (should just be dad).

@:value(new Map<String,Array<String>>())arrow_Configs:Map<String, Array<String>> = new Map<String,Array<String>>()

@:value([])baseEvents:Array<Array<Dynamic>> = []

Original Array of the current song's events.

@:value([])bfMap:Map<String, Boyfriend> = []

Map of String to Boyfriend for changing bf's character.

binds:Array<String>

Your current key bindings stored as Strings.

camFollow:FlxObject

Simple FlxObject to store the camera's current position that it's following.

camGame:FlxCamera

FlxCamera for all elements part of the main scene.

camHUD:FlxCamera

FlxCamera for all HUD/UI elements.

@:value(false)camZooming:Bool = false

Bool for whether or not the camera is currently zooming in and out to the song's beat.

@:value(1)cameraSpeed:Float = 1

Speed of camera.

@:value(1)cameraZoomRate:Float = 1

Multiplier for speed of camera bops.

@:value(1)cameraZoomSpeed:Float = 1

Speed of camera zooming.

@:value(1)cameraZoomStrength:Float = 1

Multiplier for strength of camera bops.

@:value(Options.getData("cameraZooms"))cameraZooms:Bool = Options.getData("cameraZooms")

Bool for if the camera is allowed to zoom in.

@:value(true)canFullscreen:Bool = true

@:value(true)canPause:Bool = true

@:value(false)centerCamera:Bool = false

Should the camera be centered?

@:value(0)combo:Int = 0

Current combo (or amount of notes hit in a row without a combo break).

@:value("")curSong:String = ""

Shortner for SONG.song.

@:value(SONG?.keyCount ?? 4)currentParsingKeyCount:Int = SONG?.keyCount ?? 4

@:value(SONG?.playerKeyCount ?? 4)currentParsingPlayerKeyCount:Int = SONG?.playerKeyCount ?? 4

@:value([])dadMap:Map<String, Character> = []

Map of String to Character for changing dad's character.

@:value(false)dead:Bool = false

Is the player dead?

@:value(1.05)defaultCamZoom:Float = 1.05

The default camera zoom (used for camera zooming properly).

@:value(1.0)defaultHudCamZoom:Float = 1.0

The default hud camera zoom (used for zoom the hud properly).

@:value("")detailsPausedText:String = ""

Paused Details to use in RPC.

@:value("Freeplay")detailsText:String = "Freeplay"

Details to use in RPC.

@:value(false)endingSong:Bool = false

@:value(Options.getData("enemyStrumsGlow"))enemyStrumsGlow:Bool = Options.getData("enemyStrumsGlow")

@:value([])events:Array<Array<Dynamic>> = []

Array of current events used by the song.

@:value(0.0)fixedUpdateTime:Float = 0.0

@:value(new FlxGroup())foregroundSprites:FlxGroup = new FlxGroup()

FlxGroup for all the sprites that should go above the characters in a stage.

@:value(false)generatedMusic:Bool = false

Variable for if generateSong has been called successfully yet.

@:value([])gfMap:Map<String, Character> = []

Map of String to Character for changing gf's character.

@:value(1)gfSpeed:Int = 1

The interval of beats the current gf waits till their dance function gets called. (as an Int)

Example:

1 = Every Beat,
2 = Every Other Beat,
etc.

@:value(1)health:Float = 1

Current health of the player (stored as a range from minHealth to maxHealth, which is by default 0 to 2).

healthBar:FlxBar

The health bar.

healthBarBG:FlxSprite

Background sprite for the health bar.

@:value(1)healthShown:Float = 1

Current health being shown on the healthBar. (Is inverted from normal when playing as opponent)

@:value([])heldArray:Array<Bool> = []

@:value(0.0)hitNotes:Float = 0.0

Total notes hit (is a Float because it's used for accuracy calculations).

@:value(Options.getData("hitsound"))hitSoundString:String = Options.getData("hitsound")

The current hitsound the player is using. (By default is 'none')

iconP1:HealthIcon

The icon for the player character (bf).

iconP2:HealthIcon

The icon for the opponent character (dad).

@:value("")iconRPC:String = ""

Small Icon to use in RPC.

@:value(false)inCutscene:Bool = false

Whether or not you are currently in a cutscene.

infoTxt:FlxText

Deprecated: "infoTxt is deprecated, use timeBar.txt instead"

@:value(false)invincible:Bool = false

@:value([])justPressedArray:Array<Bool> = []

@:value([])justReleasedArray:Array<Bool> = []

@:value(false)lockedCamera:Bool = false

Should the camera be locked?

@:value([])maniaChanges:Array<Dynamic> = []

@:value([])mania_gap:Array<String> = []

@:value([])mania_offset:Array<String> = []

@:value([])mania_size:Array<String> = []

@:value(Options.getData("marvelousRatings"))marvelousRatings:Bool = Options.getData("marvelousRatings")

@:value(0)maxCombo:Int = 0

Current combo (or amount of notes hit in a row without a combo break).

@:value(2)maxHealth:Float = 2

Maximum health value. (Defaults to 2)

@:value(0)minHealth:Float = 0

Minimum health value. (Defaults to 0)

@:value([])missSounds:Array<FlxSound> = []

Array of cached miss sounds.

@:value(0)misses:Int = 0

Current miss count for the player.

noteBG:FlxSprite

The note underlay colored black. Turned off by default.

notes:FlxTypedGroup<Note>

FlxTypedGroup of all currently active notes in the game.

@:value([])number_Tweens:Array<VarTween> = []

@:value([])numbers:Array<FlxSprite> = []

@:value(4)ogKeyCount:Int = 4

Keeps track of the original opponent (or both if not specified for player) key count.

(Used when playing as opponent).

@:value(4)ogPlayerKeyCount:Int = 4

Keeps track of the original player key count.

(Used when playing as opponent).

@:value(Options.getData("opponentNoteSplashes"))opponentNoteSplashes:Bool = Options.getData("opponentNoteSplashes")

Should the opponent spawn a notesplash on a sick or marvelous rating?

@:value(false)paused:Bool = false

@:value(Options.getData("playerNoteSplashes"))playerNoteSplashes:Bool = Options.getData("playerNoteSplashes")

Should the player spawn a notesplash on a sick or marvelous rating?

@:value([])prevEnemyXVals:Map<String, Float> = []

@:value([])prevPlayerXVals:Map<String, Float> = []

@:value([])previousReleased:Array<Bool> = []

@:value(new FlxSprite())rating:FlxSprite = new FlxSprite()

@:value("")ratingStr:String = ""

ratingText:FlxText

Current text that displays your ratings (plus misses and MA/PA).

@:value(["marvelous" => 0, "sick" => 0, "good" => 0, "bad" => 0, "shit" => 0])ratings:Map<String, Int> = ["marvelous" => 0, "sick" => 0, "good" => 0, "bad" => 0, "shit" => 0]

A Map of the String names of the ratings to the amount of times you got them.

@:value(new FlxSpriteGroup())ratingsGroup:FlxSpriteGroup = new FlxSpriteGroup()

@:value([])releasedArray:Array<Bool> = []

scoreTxt:FlxText

Current text under the health bar (displays score and other stats).

@:value([])scripts:Map<String, Script> = []

Map of String to LuaScript used for custom events.

@:value(0)songLength:Float = 0

Length of the current song's instrumental track in milliseconds.

@:value(0)songScore:Int = 0

Current score for the player.

@:value(0.0)song_info_timer:Float = 0.0

@:value(1.0)speed:Float = 1.0

@:value(new FlxTypedSpriteGroup<NoteSplash>())splash_group:FlxTypedSpriteGroup<NoteSplash> = new FlxTypedSpriteGroup<NoteSplash>()

FlxTypedGroup of NoteSplashs used to contain all note splashes and make performance better as a result by using .recycle.

stage:StageGroup

The current stage.

@:value([])stageMap:Map<String, StageGroup> = []

Map of String to StageGroup for changing the stage.

@:value(new FlxTimer())startTimer:FlxTimer = new FlxTimer()

@:value(false)startedCountdown:Bool = false

@:value(false)startingSong:Bool = false

Whether or not the player has started the song yet.

@:value(false)stopSong:Bool = false

Variable used by Lua Modcharts to stop the song midway.

strumLine:FlxSprite

Simple FlxSprite to help represent the strum line the strums initially spawn at.

@:value(false)switchedStates:Bool = false

@:value(0.0)time:Float = 0.0

Current time of the song in milliseconds used for the progress bar.

timeBar:TimeBar

The progress bar.

timeBarBG:FlxSprite

Deprecated: "timeBarBG is deprecated, use timeBar.bg instead"

@:value(Options.getData("timeBarStyle"))read onlytimeBarStyle:String = Options.getData("timeBarStyle")

Current time bar style selected by the player.

@:value(0)totalNotes:Int = 0

Total notes interacted with. (Includes missing and hitting)

tweenManager:FlxTweenManager

Manages tweens in lua scripts to pause when game is

@:value(new Map<String,Array<String>>())type_Configs:Map<String, Array<String>> = new Map<String,Array<String>>()

@:value([])types:Array<String> = []

@:value([])uiMap:Map<String, FlxGraphicAsset> = []

@:value([])ui_settings:Array<String> = []

@:value([])unspawnNotes:Array<Note> = []

Array of all the notes waiting to be spawned into the game (when their time comes to prevent lag).

@:value(false)usedLuaCameras:Bool = false

Used lua cameras?

@:value(new FlxVideo())videoHandler:FlxVideo = new FlxVideo()

@:value(new SoundGroup(2))vocals:SoundGroup = new SoundGroup(2)

Vocal tracks for the current song as a SoundGroup.

Methods

@:value({ removeOld : true })addCharacter(char:Character, removeOld:Bool = true):Void

@:value({ endSongVar : false })bruhDialogue(endSongVar:Bool = false):Void

@:value({ showReminders : true, isPlayer : false })generateStaticArrows(pos:Float, isPlayer:Bool = false, showReminders:Bool = true):Void

goodNoteHit(note:Note, ?setNoteDiff:Float):Void

@:value({ pause : false })moveToResultsScreen(pause:Bool = false):Void

Move to the results screen right goddamn now.

Parameters:

pause

Should the game pause?

@:value({ direction : 1 })noteMiss(direction:Int = 1, ?note:Note):Void

@:value({ force : true })playAnimOnNote(char:Character, note:Note, singAnim:String, force:Bool = true):Void

popUpScore(strumtime:Float, noteData:Int, ?setNoteDiff:Float):Void

@:value({ newCam : null })reorderCameras(?newCam:FlxCamera):Void

@:value({ executeOn : BOTH })inlineset(name:String, data:Any, executeOn:ExecuteOn = BOTH):Void

inlinesortNotes(Obj1:Note, Obj2:Note):Int

@:value({ endSongVar : false })startDialogue(?dialogueBox:DialogueBox, endSongVar:Bool = false):Void

@:value({ endSongVar : false })startVideo(name:String, ?ext:String, endSongVar:Bool = false):Void

Inherited Variables

Defined by MusicBeatState

@:value(0)curBeat:Int = 0

@:value(0)curDecBeat:Float = 0

@:value(0)curDecStep:Float = 0

@:value(0)curStep:Int = 0

Defined by ModchartMusicBeatState

Defined by FlxUIState

@:value(null)cursor:FlxUICursor = null

@:value(null)getTextFallback:(String, String, Bool) ‑> String = null

@:value(false)hideCursorOnSubstate:Bool = false

@:value(false)reload_ui_on_resize:Bool = false

read onlytooltips:FlxUITooltipManager

frontend for adding tooltips to things

Defined by FlxTransitionableState

Defined by FlxState

bgColor:FlxColor

The natural background color the cameras default to. In AARRGGBB format.

@:value(true)destroySubStates:Bool = true

If substates get destroyed when they are closed, setting this to false might reduce state creation time, at greater memory cost.

@:value(true)persistentDraw:Bool = true

Determines whether the current state is drawn, even when it is not the active state. For example, if you have your game state open first, and then you push a pause state on top of it, if this is set to true, the game state would still continue to be drawn behind that pause state.

By default, this is set to true, so the background states will continue to be "drawn" behind the current state.

If you do not want background states to be visible when you have a different state on top, then you should set this to false for improved performance.

@:value(false)persistentUpdate:Bool = false

Determines whether the current state is updated, even when it is not the active state. For example, if you have your game state open first, and then you push a pause state on top of it, if this is set to true, the game state would still continue to be updated in the background.

By default, this is set to false, so the background states will continue to be "paused" when they are not active.

read onlysubState:FlxSubState

Current substate. Substates also can be nested.

read onlysubStateClosed:FlxTypedSignal<FlxSubState ‑> Void>

A FlxSignal that dispatches when a sub state is closed from this state.

Available since

4.9.0

.

read onlysubStateOpened:FlxTypedSignal<FlxSubState ‑> Void>

A FlxSignal that dispatches when a sub state is opened from this state.

Available since

4.9.0

.

Defined by FlxTypedGroup

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

The number of entries in the members array. For performance and safety you should check this variable instead of members.length unless you really know what you're doing!

maxSize:Int

The maximum capacity of this group. Default is 0, meaning no max capacity, and the group can just grow.

read onlymemberAdded:FlxTypedSignal<T ‑> Void>

A FlxSignal that dispatches when a child is added to this group.

Available since

4.4.0

.

read onlymemberRemoved:FlxTypedSignal<T ‑> Void>

A FlxSignal that dispatches when a child is removed from this group.

Available since

4.4.0

.

read onlymembers:Array<T>

Array of all the members in this group.

@:value(true)zIndexesAllowed:Bool = true

Whether or not objects are allowed to have Z-Indexes in this group. If this is disabled, objects will render in the order they are added to the group.

This is a flag since handling Z-Indexes can be expensive, depending on how many objects are in the group.

Defined by FlxBasic

@:value(idEnumerator++)ID:Int = idEnumerator++

A unique ID starting from 0 and increasing by 1 for each subsequent FlxBasic that is created.

@:value(true)active:Bool = true

Controls whether update() is automatically called by FlxState/FlxGroup.

@:value(true)alive:Bool = true

Useful state for many game objects - "dead" (!alive) vs alive. kill() and revive() both flip this switch (along with exists, but you can override that).

camera:FlxCamera

Gets or sets the first camera of this object.

cameras:Array<FlxCamera>

This determines on which FlxCameras this object will be drawn. If it is null / has not been set, it uses the list of default draw targets, which is controlled via FlxG.camera.setDefaultDrawTarget as well as the DefaultDrawTarget argument of FlxG.camera.add.

read onlycontainer:Null<FlxContainer>

The parent containing this basic, typically if you check this recursively you should reach the state

Available since

5.7.0

.

@:value(true)exists:Bool = true

Controls whether update() and draw() are automatically called by FlxState/FlxGroup.

@:value(true)visible:Bool = true

Controls whether draw() is automatically called by FlxState/FlxGroup.

@:value(0)zIndex:Int = 0

The z-index of this object, used for dynamically layering objects after adding them to groups.

Inherited Methods

Defined by MusicBeatState

Defined by FlxUIState

getEvent(id:String, sender:Dynamic, data:Dynamic, ?params:Array<Dynamic>):Void

getRequest(id:String, sender:Dynamic, data:Dynamic, ?params:Array<Dynamic>):Dynamic

@:value({ Safe : true, Context : "ui" })getText(Flag:String, Context:String = "ui", Safe:Bool = true):String

onShowTooltip(t:FlxUITooltip):Void

Available since

2.1.0

.

@:value({ height : 600, width : 800 })resizeScreen(width:Float = 800, height:Float = 600):Void

Defined by FlxTransitionableState

transitionIn():Void

Starts the in-transition. Can be called manually at any time.

transitionOut(?OnExit:() ‑> Void):Void

Starts the out-transition. Can be called manually at any time.

Defined by FlxState

resetSubState():Void

Load substate for this state

Defined by FlxTypedGroup

add(basic:T):T

Adds a new FlxBasic subclass (FlxBasic, FlxSprite, Enemy, etc) to the group. FlxGroup will try to replace a null member of the array first. Failing that, FlxGroup will add it to the end of the member array. WARNING: If the group has a maxSize that has already been met, the object will NOT be added to the group!

Parameters:

basic

The FlxBasic you want to add to the group.

Returns:

The same FlxBasic object that was passed in.

any(func:T ‑> Bool):Bool

Tests whether any member satisfies the function.

Parameters:

func

The function that tests the members

Available since

5.4.0

.

clear():Void

Remove all instances of FlxBasic subclasses (FlxSprite, FlxTileblock, etc) from the list. WARNING: does not destroy() or kill() any of these objects!

countDead():Int

Call this function to find out how many members of the group are dead.

Returns:

The number of FlxBasics flagged as dead. Returns -1 if group is empty.

countLiving():Int

Call this function to find out how many members of the group are not dead.

Returns:

The number of FlxBasics flagged as not dead. Returns -1 if group is empty.

every(func:T ‑> Bool):Bool

Tests whether every member satisfies the function.

Parameters:

func

The function that tests the members

Available since

5.4.0

.

@:value({ recurse : false })forEach(func:T ‑> Void, recurse:Bool = false):Void

Applies a function to all members.

Parameters:

func

A function that modifies one element at a time.

recurse

Whether or not to apply the function to members of subgroups as well.

@:value({ recurse : false })forEachAlive(func:T ‑> Void, recurse:Bool = false):Void

Applies a function to all alive members.

Parameters:

func

A function that modifies one element at a time.

recurse

Whether or not to apply the function to members of subgroups as well.

@:value({ recurse : false })forEachDead(func:T ‑> Void, recurse:Bool = false):Void

Applies a function to all dead members.

Parameters:

func

A function that modifies one element at a time.

recurse

Whether or not to apply the function to members of subgroups as well.

@:value({ recurse : false })forEachExists(func:T ‑> Void, recurse:Bool = false):Void

Applies a function to all existing members.

Parameters:

func

A function that modifies one element at a time.

recurse

Whether or not to apply the function to members of subgroups as well.

@:value({ recurse : false })forEachOfType<K>(objectClass:Class<K>, func:K ‑> Void, recurse:Bool = false):Void

Applies a function to all members of type Class<K>.

Parameters:

objectClass

A class that objects will be checked against before Function is applied, ex: FlxSprite.

func

A function that modifies one element at a time.

recurse

Whether or not to apply the function to members of subgroups as well.

getFirst(func:T ‑> Bool):Null<T>

Searches for, and returns the first member that satisfies the function.

Parameters:

func

The function that tests the members

Available since

5.4.0

.

getFirstAlive():Null<T>

Call this function to retrieve the first object with dead == false in the group. This is handy for checking if everything's wiped out, or choosing a squad leader, etc.

Returns:

A FlxBasic currently flagged as not dead.

@:value({ force : false })getFirstAvailable(?objectClass:Class<T>, force:Bool = false):Null<T>

Call this function to retrieve the first object with exists == false in the group. This is handy for recycling in general, e.g. respawning enemies.

Parameters:

objectClass

An optional parameter that lets you narrow the results to instances of this particular class.

force

Force the object to be an ObjectClass and not a super class of ObjectClass.

Returns:

A FlxBasic currently flagged as not existing.

getFirstDead():Null<T>

Call this function to retrieve the first object with dead == true in the group. This is handy for checking if everything's wiped out, or choosing a squad leader, etc.

Returns:

A FlxBasic currently flagged as dead.

getFirstExisting():Null<T>

Call this function to retrieve the first object with exists == true in the group. This is handy for checking if everything's wiped out, or choosing a squad leader, etc.

Returns:

A FlxBasic currently flagged as existing.

getFirstIndex(func:T ‑> Bool):Int

Searches for, and returns the index of the first member that satisfies the function.

Parameters:

func

The function that tests the members

Available since

5.4.0

.

getFirstNull():Int

Call this function to retrieve the first index set to null. Returns -1 if no index stores a null object.

Returns:

An Int indicating the first null slot in the group.

getLast(func:T ‑> Bool):Null<T>

Searches for, and returns the last member that satisfies the function.

Parameters:

func

The function that tests the members

Available since

5.4.0

.

getLastIndex(func:T ‑> Bool):Int

Searches for, and returns the index of the last member that satisfies the function.

Parameters:

func

The function that tests the members

Available since

5.4.0

.

@:value({ length : 0, startIndex : 0 })getRandom(startIndex:Int = 0, length:Int = 0):T

Returns a member at random from the group.

Parameters:

startIndex

Optional offset off the front of the array. Default value is 0, or the beginning of the array.

length

Optional restriction on the number of values you want to randomly select from.

Returns:

A FlxBasic from the members list.

insert(position:Int, object:T):T

Inserts a new FlxBasic subclass (FlxBasic, FlxSprite, Enemy, etc) into the group at the specified position. FlxGroup will try to replace a null member at the specified position of the array first. Failing that, FlxGroup will insert it at the position of the member array. WARNING: If the group has a maxSize that has already been met, the object will NOT be inserted to the group!

Parameters:

position

The position in the group where you want to insert the object.

object

The object you want to insert into the group.

Returns:

The same FlxBasic object that was passed in.

inlineiterator(?filter:T ‑> Bool):FlxTypedGroupIterator<T>

Iterates through every member.

inlinekeyValueIterator():ArrayKeyValueIterator<T>

Iterates through every member and index.

kill():Void

Calls killMembers() and then kills the group itself. Revive this group via revive().

killMembers():Void

Calls kill() on the group's unkilled members. Revive them via reviveMembers().

Available since

5.4.0

.

@:value({ revive : true, force : false })recycle(?objectClass:Class<T>, ?objectFactory:() ‑> T, force:Bool = false, revive:Bool = true):T

Recycling is designed to help you reuse game objects without always re-allocating or "newing" them. It behaves differently depending on whether maxSize equals 0 or is bigger than 0.

maxSize > 0 / "rotating-recycling" (used by FlxEmitter): - at capacity: returns the next object in line, no matter its properties like alive, exists etc. - otherwise: returns a new object.

maxSize == 0 / "grow-style-recycling" - tries to find the first object with exists == false - otherwise: adds a new object to the members array

WARNING: If this function needs to create a new object, and no object class was provided, it will return null instead of a valid object!

Parameters:

objectClass

The class type you want to recycle (e.g. FlxSprite, EvilRobot, etc).

objectFactory

Optional factory function to create a new object if there aren't any dead members to recycle. If null, Type.createInstance() is used, which requires the class to have no constructor parameters.

force

Force the object to be an ObjectClass and not a super class of ObjectClass.

revive

Whether recycled members should automatically be revived (by calling revive() on them).

Returns:

A reference to the object that was created.

@:value({ splice : false })remove(basic:T, splice:Bool = false):T

Removes an object from the group.

Parameters:

basic

The FlxBasic you want to remove.

splice

Whether the object should be cut from the array entirely or not.

Returns:

The removed object.

replace(oldObject:T, newObject:T):T

Replaces an existing FlxBasic with a new one. Does not do anything and returns null if the old object is not part of the group.

Parameters:

oldObject

The object you want to replace.

newObject

The new object you want to use instead.

Returns:

The new object.

revive():Void

Calls reviveMembers() and then revives the group itself.

reviveMembers():Void

Calls revive() on the group's killed members and then on the group itself.

Available since

5.4.0

.

@:value({ order : FlxSort.ASCENDING })inlinesort(func:(Int, T, T) ‑> Int, order:Int = FlxSort.ASCENDING):Void

Call this function to sort the group according to a particular value and order. For example, to sort game objects for Zelda-style overlaps you might call group.sort(FlxSort.byY, FlxSort.ASCENDING) at the bottom of your FlxState#update() override.

Parameters:

func

The sorting function to use - you can use one of the premade ones in FlxSort or write your own using FlxSort.byValues() as a "backend".

order

A constant that defines the sort order. Possible values are FlxSort.ASCENDING (default) and FlxSort.DESCENDING.

Defined by FlxBasic

getCameras():Array<FlxCamera>

The cameras that will draw this. Use this.cameras to set specific cameras for this object, otherwise the container's cameras are used, or the container's container and so on. If there is no container, say, if this is inside FlxGroups rather than a FlxContainer then the default draw cameras are returned.

Available since

5.7.0

.

getDefaultCamera():FlxCamera

The main camera that will draw this. Use this.cameras to set specific cameras for this object, otherwise the container's camera is used, or the container's container and so on. If there is no container, say, if this is inside FlxGroups rather than a FlxContainer then FlxG.camera is returned.

Available since

5.7.0

.