Try to fix the characters dancing fast?
This commit is contained in:
@@ -15,6 +15,7 @@ import flixel.math.FlxRect;
|
||||
import flixel.math.FlxPoint;
|
||||
import flixel.util.typeLimit.OneOfTwo;
|
||||
import funkin.backend.system.interfaces.IBeatReceiver;
|
||||
import funkin.backend.system.Conductor;
|
||||
|
||||
enum abstract XMLAnimType(Int)
|
||||
{
|
||||
@@ -140,9 +141,9 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
|
||||
private var countedBeat = 0;
|
||||
public function beatHit(curBeat:Int)
|
||||
{
|
||||
if (beatAnims.length > 0 && (curBeat + beatOffset) % beatInterval == 0)
|
||||
if (Conductor.curBeat != curBeat || (skipNegativeBeats && curBeat < 0)) return;
|
||||
if (beatAnims.length > 0 && (curBeat + beatOffset - Conductor.lastBeatChange) % (beatInterval * CoolUtil.minInt(Math.floor(4 / Conductor.stepsPerBeat), 1)) == 0)
|
||||
{
|
||||
if(skipNegativeBeats && curBeat < 0) return;
|
||||
// TODO: find a solution without countedBeat
|
||||
var anim = beatAnims[FlxMath.wrap(countedBeat++, 0, beatAnims.length - 1)];
|
||||
if (anim.name != null && anim.name != "null" && anim.name != "none")
|
||||
|
||||
@@ -167,13 +167,14 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
|
||||
}
|
||||
|
||||
/**
|
||||
* Whenever the character should dance on beat or not. Set to false for `gf`, since the dance animation is automatically handled by PlayState.
|
||||
* Whenever the character should dance on beat or not.
|
||||
*/
|
||||
public var danceOnBeat:Bool = true;
|
||||
public override function beatHit(curBeat:Int) {
|
||||
scripts.call("beatHit", [curBeat]);
|
||||
|
||||
if (danceOnBeat && (curBeat + beatOffset) % beatInterval == 0 && !__lockAnimThisFrame)
|
||||
if (Conductor.curBeat != curBeat || (skipNegativeBeats && curBeat < 0)) return;
|
||||
if (danceOnBeat && (curBeat + beatOffset - Conductor.lastBeatChange) % (beatInterval * CoolUtil.minInt(Math.floor(4 / Conductor.stepsPerBeat), 1)) == 0 && !__lockAnimThisFrame)
|
||||
tryDance();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user