mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-05-25 16:41:05 +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;
|
alpha = 0.6;
|
||||||
|
|
||||||
animation.play('note' + noteData + '-' + FlxG.random.int(0, 1), true);
|
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();
|
updateHitbox();
|
||||||
|
|
||||||
offset.set(width * 0.3, height * 0.3);
|
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