Scrolling notes based on note speed and position.
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
7f9b9974ff
commit
8d72f24074
@ -33,7 +33,7 @@ public class Canvas extends JPanel{
|
||||
for (int i=0;i<9;i++) {
|
||||
int LANE_X_OFFSET = (i-5)*LANE_SPACING_X+LANE_SPACING_X/2+JUDGEMENT_LINE_WIDTH/2;
|
||||
|
||||
if (LLSIG.game.keyState[i]) {
|
||||
if (LLSIG.keyState[i]) {
|
||||
g.setColor(Color.MAGENTA);
|
||||
} else {
|
||||
g.setColor(Color.GRAY);
|
||||
@ -46,8 +46,9 @@ public class Canvas extends JPanel{
|
||||
int noteCounter = 0;
|
||||
while (lane.noteExists(noteCounter)) {
|
||||
Note n = lane.getNote(noteCounter);
|
||||
int NOTE_Y_OFFSET = (int)((((double)LLSIG.game.musicPlayer.getPlayPosition()-n.getStartFrame())/1000)*60*LLSIG.game.noteSpeed);
|
||||
g.fillOval(MIDDLE_X-NOTE_SIZE/2+LANE_X_OFFSET,MIDDLE_Y-NOTE_SIZE/2+NOTE_Y_OFFSET,NOTE_SIZE,NOTE_SIZE);
|
||||
if (LLSIG.game.musicPlayer.getPlayPosition()-n.getStartFrame()<LLSIG.game.NOTE_SPEED) {
|
||||
g.fillOval((int)(MIDDLE_X-Math.cos(Math.toRadians(22.5*i))*((1-(((double)LLSIG.game.musicPlayer.getPlayPosition()-n.getStartFrame())/LLSIG.game.NOTE_SPEED))*NOTE_DISTANCE)-NOTE_SIZE/2),(int)(MIDDLE_Y+Math.sin(Math.toRadians(22.5*i))*((1-(((double)LLSIG.game.musicPlayer.getPlayPosition()-n.getStartFrame())/LLSIG.game.NOTE_SPEED))*NOTE_DISTANCE)-NOTE_SIZE/2),NOTE_SIZE,NOTE_SIZE);
|
||||
}
|
||||
noteCounter++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ public class LLSIG implements KeyListener{
|
||||
ScheduledThreadPoolExecutor stpe = new ScheduledThreadPoolExecutor(1);
|
||||
int frameCount;
|
||||
public static LLSIG game;
|
||||
int noteSpeed = 4;
|
||||
int NOTE_SPEED = 1000; //The note speed determines how early you see the note. So lowering this number increases the speed.
|
||||
List<Lane> lanes = new ArrayList<Lane>();
|
||||
|
||||
String song = "MiChi - ONE-315959669";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user