class Bopper
package funkin.play.stage
extends StageProp › FunkinSprite
implements IPlayStateScriptedClass
extended by BaseCharacter, ScriptedBopper, LevelProp
Available on all platforms
A Bopper is a stage prop which plays a dance animation. Y'know, a thingie that bops. A bopper.
Constructor
Variables
animationOffsets:Map<String, Array<Float>> = new Map<String,Array<Float>>()
Offset the character's sprite by this much when playing each animation.
danceEvery:Float = 0.0
The bopper plays the dance animation once every danceEvery beats.
Set to 0 to disable idle animation.
Supports up to 0.25 precision.
globalOffsets:Array<Float> = [0, 0]
The offset of the character relative to the position specified by the stage.
idleSuffix:String = ""
Add a suffix to the idle animation (or danceLeft and danceRight animations)
that this bopper will play.
shouldAlternate:Null<Bool> = null
Whether the bopper should dance left and right.
- If true, alternate playing danceLeft and danceRight.
- If false, play idle every time.
You can manually set this value, or you can leave it as null to determine it automatically.
shouldBop:Bool = true
Whether this bopper should bop every beat. By default it's true, but when used for characters/players, it should be false so it doesn't cut off their animations!!!!!
Methods
forceAnimationForDuration(name:String, duration:Float):Void
Parameters:
name | The animation to play. |
|---|---|
duration | The duration in which other (non-forced) animations will be skipped, in seconds (NOT MILLISECONDS). |
playAnimation(name:String, restart:Bool = false, ignoreOther:Bool = false, reversed:Bool = false):Void
Parameters:
name | The name of the animation to play. |
|---|---|
restart | Whether to restart the animation if it is already playing. |
ignoreOther | Whether to ignore all other animation inputs, until this one is done playing |
reversed | If true, play the animation backwards, from the last frame to the first. |
resetPosition():Void
If this Bopper was defined by the stage, return the prop to its original position.