Constructor
Variables
time:Float
The position of this group in milliseconds. +
Constructor
Variables
Methods
Inherited Variables
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.
4.4.0
.read onlymemberRemoved:FlxTypedSignal<T ‑> Void>
A FlxSignal
that dispatches when a child is removed from this group.
4.4.0
.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)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).
cameras:Array<FlxCamera>
This determines on which FlxCamera
s this object will be drawn. If it is null
/ has not been
@@ -17,7 +17,12 @@
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 |
---|
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 |
---|
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 FlxBasic
s 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 FlxBasic
s 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 |
---|
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
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 |
---|
5.4.0
.getFirstAlive():Null<T>
Call this function to retrieve the first object with dead == false
in the group.
+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 FlxBasic
s 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 FlxBasic
s flagged as not dead. Returns -1
if group is empty.
destroy():Void
WARNING: A destroyed FlxBasic
can't be used anymore.
+It may even cause crashes if it is still part of a group or state.
+You may want to use kill()
instead if you want to disable the object temporarily only and revive()
it later.
This function is usually not called manually (Flixel calls it automatically during state switches for all add()
ed objects).
Override this function to null
out variables manually or call destroy()
on class members if necessary.
+Don't forget to call super.destroy()
!
every(func:T ‑> Bool):Bool
Tests whether every member satisfies the function.
Parameters:
func | The function that tests the members |
---|
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
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 |
---|
5.4.0
.getFirstAlive():Null<T>
@: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 |
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.
diff --git a/states/PlayState.html b/states/PlayState.html
index 532ca3dd2b..6b98d6e027 100644
--- a/states/PlayState.html
+++ b/states/PlayState.html
@@ -20,7 +20,7 @@
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).
@:value(1)healthShown:Float = 1
Current health
being shown on the healthBar
. (Is inverted from normal when playing as opponent)
@: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')
@:value(Options.getData("marvelousRatings"))marvelousRatings:Bool = Options.getData("marvelousRatings")
@: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).
@:value(1)healthShown:Float = 1
Current health
being shown on the healthBar
. (Is inverted from normal when playing as opponent)
@: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')
@:value(Options.getData("marvelousRatings"))marvelousRatings:Bool = Options.getData("marvelousRatings")
@: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(Options.getData("playerNoteSplashes"))playerNoteSplashes:Bool = Options.getData("playerNoteSplashes")
Should the player spawn a notesplash on a sick or marvelous rating?
@: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]
@:value(new FlxTypedSpriteGroup<NoteSplash>())splash_group:FlxTypedSpriteGroup<NoteSplash> = new FlxTypedSpriteGroup<NoteSplash>()
FlxTypedGroup
of NoteSplash
s used to contain all note splashes