Mark notes for deletion when they are passed a rewinded point.

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2, Sig, Sigo 3 years ago
parent 287fb0535b
commit d32f46f279
  1. 4
      LLSIG/src/main/java/LLSIG/LLSIG.java
  2. 2
      LLSIG/src/main/java/LLSIG/Lane.java
  3. 4
      LLSIG/src/main/java/LLSIG/Note.java

@ -318,6 +318,10 @@ public class LLSIG implements KeyListener{
beatNumber=Math.max(0,beatNumber-12); beatNumber=Math.max(0,beatNumber-12);
} }
musicPlayer.seek((long)(Math.floor(musicPlayer.getPlayPosition()-(beatDelay*12)))); musicPlayer.seek((long)(Math.floor(musicPlayer.getPlayPosition()-(beatDelay*12))));
double noteBeat = Math.round(((musicPlayer.getPlayPosition()-offset)/beatDelay)*NOTE_RECORD_BEAT_SNAP_MULTIPLE)/(double)NOTE_RECORD_BEAT_SNAP_MULTIPLE;
LLSIG.game.lanes.forEach((l)->{
l.noteChart.forEach((note)->{if (note.getBeatSnap()>noteBeat) {note.markForDeletion();}});
});
}break; }break;
case KeyEvent.VK_S:{lane=1;}break; case KeyEvent.VK_S:{lane=1;}break;
case KeyEvent.VK_D:{lane=2;}break; case KeyEvent.VK_D:{lane=2;}break;

@ -15,7 +15,7 @@ public class Lane{
return currentNoteIndex==noteChart.size()-1; return currentNoteIndex==noteChart.size()-1;
} }
public void clearOutInactiveNotes() { public void clearOutInactiveNotes() {
noteChart.removeIf(note->!note.active&&!note.active2); noteChart.removeIf(note->note.deleted||(!note.active&&!note.active2));
} }
public boolean noteExists() { public boolean noteExists() {
return getNote()!=null; return getNote()!=null;

@ -6,6 +6,7 @@ public class Note {
boolean active=true; //Set to false when the note has been scored. boolean active=true; //Set to false when the note has been scored.
boolean active2=false; //Set to false when the end section of the note has been scored. boolean active2=false; //Set to false when the end section of the note has been scored.
double beatSnapStart,beatSnapEnd = -1; double beatSnapStart,beatSnapEnd = -1;
boolean deleted=false; //Set this marker to delete it on the next frame (when using the editor)
public Note(NoteType type,double start,double end) { public Note(NoteType type,double start,double end) {
this.type=type; this.type=type;
this.start=start; this.start=start;
@ -47,6 +48,9 @@ public class Note {
public double getBeatSnapEnd() { public double getBeatSnapEnd() {
return beatSnapEnd; return beatSnapEnd;
} }
public void markForDeletion() {
deleted=true;
}
@Override @Override
public String toString() { public String toString() {
return "Note [type=" + type + ", start=" + start + ", end=" + end + "]"; return "Note [type=" + type + ", start=" + start + ", end=" + end + "]";

Loading…
Cancel
Save