1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-29 02:04:28 +00:00

Merge branch 'feature/new-input-system-yay' into feature/chart-editor-song-preview

This commit is contained in:
EliteMasterEric 2023-07-26 20:03:37 -04:00
commit 03444161e8
4 changed files with 54 additions and 2 deletions

View file

@ -66,8 +66,10 @@
},
{
"name": "hxCodec",
"type": "haxelib",
"version": "3.0.1"
"type": "git",
"dir": null,
"ref": "develop",
"url": "https://github.com/polybiusproxy/hxCodec"
},
{
"name": "hxcpp",

View file

@ -686,6 +686,9 @@ class PlayState extends MusicBeatSubState
currentStage.resetStage();
playerStrumline.clean();
opponentStrumline.clean();
// Delete all notes and reset the arrays.
regenNoteData();

View file

@ -398,6 +398,38 @@ class Strumline extends FlxSpriteGroup
return heldKeys[dir];
}
/**
* Called when the song is reset.
* Removes any special animations and the like.
* Doesn't reset the notes from the chart, that's handled by the PlayState.
*/
public function clean():Void
{
for (note in notes.members)
{
if (note == null) continue;
killNote(note);
}
for (holdNote in holdNotes.members)
{
if (holdNote == null) continue;
holdNote.kill();
}
for (splash in noteSplashes)
{
if (splash == null) continue;
splash.kill();
}
for (cover in noteHoldCovers)
{
if (cover == null) continue;
cover.kill();
}
}
public function applyNoteData(data:Array<SongNoteData>):Void
{
this.notes.clear();
@ -425,6 +457,7 @@ class Strumline extends FlxSpriteGroup
public function killNote(note:NoteSprite):Void
{
if (note == null) return;
note.visible = false;
notes.remove(note, false);
note.kill();

View file

@ -289,6 +289,20 @@ class SustainTrail extends FlxSprite
missedNote = false;
}
public override function revive():Void
{
super.revive();
strumTime = 0;
noteDirection = 0;
sustainLength = 0;
fullSustainLength = 0;
noteData = null;
hitNote = false;
missedNote = false;
}
override public function destroy():Void
{
vertices = null;