mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-09-11 20:57:20 +00:00
notesplash framerate & use finishCallback instead of checking every frame
This commit is contained in:
parent
624cc4b3fa
commit
1033754ad3
|
@ -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