mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-03-23 05:15:14 -04:00
notesplash framerate & use finishCallback instead of checking every frame
This commit is contained in:
parent
624cc4b3fa
commit
1033754ad3
1 changed files with 4 additions and 9 deletions
|
@ -31,17 +31,12 @@ class NoteSplash extends FlxSprite
|
|||
alpha = 0.6;
|
||||
|
||||
animation.play('note' + noteData + '-' + FlxG.random.int(0, 1), true);
|
||||
animation.curAnim.frameRate += FlxG.random.int(-2, 2);
|
||||
animation.curAnim.frameRate = 24 + FlxG.random.int(-2, 2);
|
||||
animation.finishCallback = function(name){
|
||||
kill();
|
||||
};
|
||||
updateHitbox();
|
||||
|
||||
offset.set(width * 0.3, height * 0.3);
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
if (animation.curAnim.finished)
|
||||
kill();
|
||||
|
||||
super.update(elapsed);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue