class BaseCharacter
package funkin.play.character
extends Bopper › StageProp › FunkinSprite
extended by AnimateAtlasCharacter, MultiAnimateAtlasCharacter, MultiSparrowCharacter, PackerCharacter, ScriptedBaseCharacter, SparrowCharacter
Available on all platforms
A Character is a stage prop which bops to the music as well as controlled by the strumlines.
Remember: The character's origin is at its FEET. (horizontal center, vertical bottom)
Constructor
Variables
read onlycameraFocusPoint:FlxPoint = new FlxPoint(0, 0)
Returns the point the camera should focus on. Should be approximately centered on the character, and should not move based on the current animation.
Set the position of this rather than reassigning it, so that anything referencing it will not be affected.
read onlycharacterOrigin:FlxPoint
The offset between the corner of the sprite and the origin of the sprite (at the character's feet). cornerPosition = stageData - characterOrigin
read onlycomboNoteCounts:Array<Int>
This character plays a given animation when hitting these specific combo numbers.
debug:Bool = false
Set to true when the character being used in a special way. This includes the Chart Editor and the Animation Editor.
Used by scripts to ensure that they don't try to run code to interact with the stage when the stage doesn't actually exist.
read onlydropNoteCounts:Array<Int>
This character plays a given animation when dropping combos larger than these numbers.
read onlyfeetPosition:FlxPoint
The absolute position of the character's feet, at the bottom-center of the sprite.
holdTimer:Float = 0
Tracks how long, in seconds, the character has been playing the current sing animation.
This is used to ensure that characters play the sing animations for at least one beat,
preventing them from reverting to the idle animation between notes.
Methods
getDataFlipX():Bool
Gets the value of flipX from the character data.
!getFlipX() is the direction Boyfriend should face.
onNoteGhostMiss(event:GhostMissNoteScriptEvent):Void
Every time a wrong key is pressed, play the miss animation if we are Boyfriend.
onNoteHit(event:HitNoteScriptEvent):Void
Every time a note is hit, check if the note is from the same strumline. If it is, then play the sing animation.
onNoteMiss(event:NoteScriptEvent):Void
Every time a note is missed, check if the note is from the same strumline. If it is, then play the sing animation.
playSingAnimation(dir:NoteDirection, miss:Bool = false, suffix:String = ""):Void
Play the appropriate singing animation, for the given note direction.
Parameters:
dir | The direction of the note. |
|---|---|
miss | If true, play the miss animation instead of the sing animation. |
suffix | A suffix to append to the animation name, like |
resetCharacter(resetCamera:Bool = true):Void
Reset the character so it can be used at the start of the level. Call this when restarting the level.
setScale(scale:Null<Float>):Void
Set the character's sprite scale to the appropriate value.
Parameters:
scale | The desired scale. |
|---|