Character
| Kind | class |
| Package | objects |
| Full name | objects.Character |
| Source | source/objects/Character.hx |
| Extends | FlxSprite |
Known subclasses: Boyfriend
Public fields
| Name | Type | Static | Default | Notes |
|---|---|---|---|---|
animOffsets | Map<String, Array<Dynamic>> | no | — | — |
debugMode | Bool | no | false | — |
isPlayer | Bool | no | false | — |
curCharacter | String | no | DEFAULT_CHARACTER | — |
colorTween | FlxTween | no | — | — |
holdTimer | Float | no | 0 | — |
heyTimer | Float | no | 0 | — |
specialAnim | Bool | no | false | — |
animationNotes | Array<Dynamic> | no | [] | — |
stunned | Bool | no | false | — |
singDuration | Float | no | 4 | — |
idleSuffix | String | no | '' | — |
danceIdle | Bool | no | false | — |
skipDance | Bool | no | false | — |
healthIcon | String | no | 'face' | — |
animationsArray | Array<AnimArray> | no | [] | — |
noteskin | String | no | — | — |
positionArray | Array<Float> | no | [0, 0] | — |
cameraPosition | Array<Float> | no | [0, 0] | — |
otherCharacters | Array<Character> | no | — | — |
hasMissAnimations | Bool | no | false | — |
vocalsFile | String | no | '' | — |
isDeathCharacter | Bool | no | false | — |
isPlaceholder | Bool | no | false | True when this character is a code-generated stand-in (its JSON, and the DEFAULT_CHARACTER fallback, were both missing). This is always the case for built-in characters in content-stripped (NO_BUILTIN_CONTENT) builds. |
healthDrain | Bool | no | false | — |
drainAmount | Float | no | 0 | — |
drainFloor | Float | no | 0 | — |
shakeScreen | Bool | no | false | — |
shakeIntensity | Float | no | 0 | — |
shakeDuration | Float | no | 0 | — |
imageFile | String | no | '' | Used on Character Editor |
jsonScale | Float | no | 1 | — |
noAntialiasing | Bool | no | false | — |
originalFlipX | Bool | no | false | — |
editorIsPlayer | Null<Bool> | no | null | — |
healthColorArray | Array<Int> | no | [255, 0, 0] | — |
trailLength | Null<Int> | no | 4 | — |
trailDelay | Null<Int> | no | 24 | — |
trailAlpha | Null<Float> | no | 0.3 | — |
trailDiff | Null<Float> | no | 0.069 | — |
flixelTrail | Bool | no | false | — |
DEFAULT_CHARACTER | String | yes | 'bf' | — |
animPaused | Bool | no | — | property (get, set) |
danced | Bool | no | false | — |
danceEveryNumBeats | Int | no | 2 | — |
isAnimateAtlas | Bool | no | false | Atlas support special thanks ne_eo for the references, you're the goat!! |
atlas | FlxAnimate | no | — | #if flxanimate |
Public methods
dummyFile
static function dummyFile():CharacterFile
Minimal valid character file used when no JSON could be loaded at all (content-stripped builds, or a typo'd character with no BF fallback). The chart editor uses this so it can open without any characters installed.
placeholderColor
static function placeholderColor(charName:String):FlxColor
Deterministic stand-in color derived from a character name, so every placeholder (character body, health icon) for the same name matches.
| Parameter | Type | Default |
|---|---|---|
charName | String | — |
new (constructor)
function new(x:Float, y:Float, character:String = 'bf', isPlayer:Bool = false, isDeathCharacter:Bool = false)
| Parameter | Type | Default |
|---|---|---|
x | Float | — |
y | Float | — |
character (optional) | String | 'bf' |
isPlayer (optional) | Bool | false |
isDeathCharacter (optional) | Bool | false |
loadCharacterFile
function loadCharacterFile(json:CharacterFile)
| Parameter | Type | Default |
|---|---|---|
json | CharacterFile | — |
loadPlaceholderCharacter
function loadPlaceholderCharacter(charName:String)
Builds a fully functional single-frame stand-in character: a solid box with every animation the engine may request (sing/miss, dance, taunts, death poses). Used when the character JSON (and the BF fallback) could not be loaded, which is always the case for built-in characters in content-stripped (NO_BUILTIN_CONTENT) builds.
| Parameter | Type | Default |
|---|---|---|
charName | String | — |
isAnimationNull
inline function isAnimationNull():Bool
getAnimationName
inline function getAnimationName():String
isAnimationFinished
function isAnimationFinished():Bool
finishAnimation
function finishAnimation():Void
hasAnimation
function hasAnimation(anim:String):Bool
| Parameter | Type | Default |
|---|---|---|
anim | String | — |
dance
function dance()
FOR GF DANCING SHIT
playAnim
function playAnim(AnimName:String, Force:Bool = false, Reversed:Bool = false, Frame:Int = 0):Void
| Parameter | Type | Default |
|---|---|---|
AnimName | String | — |
Force (optional) | Bool | false |
Reversed (optional) | Bool | false |
Frame (optional) | Int | 0 |
recalculateDanceIdle
function recalculateDanceIdle()
addOffset
function addOffset(name:String, x:Float = 0, y:Float = 0)
| Parameter | Type | Default |
|---|---|---|
name | String | — |
x (optional) | Float | 0 |
y (optional) | Float | 0 |
quickAnimAdd
function quickAnimAdd(name:String, anim:String)
| Parameter | Type | Default |
|---|---|---|
name | String | — |
anim | String | — |
draw
override function draw()
Only compiled when #if flxanimate.
copyAtlasValues
function copyAtlasValues()
Only compiled when #if flxanimate.
destroy
override function destroy()
Only compiled when #if flxanimate.
destroyAtlas
function destroyAtlas()
Only compiled when #if flxanimate.
Internals
Private / internal members
| Field | Type | Static |
|---|---|---|
anim | String | no |
_lastPlayedAnimation | String | no |
daOffset | — | no |
settingCharacterUp | Bool | no |
| Method |
|---|
override function update(elapsed:Float) |
function get_animPaused():Bool |
function set_animPaused(value:Bool):Bool |
function loadMappedAnims():Void |
function sortAnims(Obj1:Array<Dynamic>, Obj2:Array<Dynamic>):Int |