@@ -35,6 +35,7 @@ public struct SongData
3535 }
3636
3737 private SongData _curSong ;
38+
3839 //Assume queue structure for notes in each lane.
3940 private readonly Note [ ] [ ] _laneNotes = new Note [ ] [ ]
4041 {
@@ -64,7 +65,8 @@ public override void _Process(double delta)
6465 double curBeat = TimeKeeper . CurrentTime / ( 60 / ( double ) _curSong . Bpm ) ;
6566 for ( int i = 0 ; i < _laneNotes . Length ; i ++ )
6667 {
67- if ( _laneNotes [ i ] . Length <= 0 ) continue ;
68+ if ( _laneNotes [ i ] . Length <= 0 )
69+ continue ;
6870 double beatDif = ( curBeat - _laneNotes [ i ] . First ( ) . Beat ) ;
6971 if ( beatDif > 1 )
7072 {
@@ -105,9 +107,7 @@ private void OnNotePressed(NoteArrow.ArrowType type)
105107 CheckNoteTiming ( type ) ;
106108 }
107109
108- private void OnNoteReleased ( NoteArrow . ArrowType arrowType )
109- {
110- }
110+ private void OnNoteReleased ( NoteArrow . ArrowType arrowType ) { }
111111
112112 private void handleTiming ( NoteArrow . ArrowType type , double beatDif )
113113 {
@@ -144,12 +144,28 @@ private void CheckNoteTiming(NoteArrow.ArrowType type)
144144 {
145145 double curBeat = TimeKeeper . CurrentTime / ( 60 / ( double ) _curSong . Bpm ) ;
146146 if ( _laneNotes [ ( int ) type ] . Length == 0 )
147+ {
148+ PlayerAddNote ( type , ( int ) curBeat , 100 ) ; // 100 is temp, replace with current combo
147149 return ;
150+ }
148151 double beatDif = Math . Abs ( curBeat - _laneNotes [ ( int ) type ] . First ( ) . Beat ) ;
149152 if ( beatDif > 1 )
153+ {
154+ PlayerAddNote ( type , ( int ) curBeat , 100 ) ; // 100 is temp, replace with current combo
150155 return ;
156+ }
151157 GD . Print ( "Note Hit. Dif: " + beatDif ) ;
152158 CM . HandleNote ( type ) ;
153159 handleTiming ( type , beatDif ) ;
154160 }
161+
162+ private void PlayerAddNote ( NoteArrow . ArrowType type , int beat , int currentCombo )
163+ {
164+ // can also add some sort of keybind here to also have pressed
165+ // in case the user just presses the note too early and spawns a note
166+ if ( currentCombo >= 100 )
167+ {
168+ CM . CreateNote ( type , beat ) ;
169+ }
170+ }
155171}
0 commit comments