Make circular note layout and error handling.

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
Nic0Nic0Nii 3 years ago
parent 9189ffc9ba
commit bd55f7a411
  1. 27
      LLSIG/.classpath
  2. 6
      LLSIG/.project
  3. 4
      LLSIG/.settings/org.eclipse.core.resources.prefs
  4. 2
      LLSIG/.settings/org.eclipse.jdt.apt.core.prefs
  5. 10
      LLSIG/.settings/org.eclipse.jdt.core.prefs
  6. 4
      LLSIG/.settings/org.eclipse.m2e.core.prefs
  7. 1
      LLSIG/coauthors.sh
  8. 13
      LLSIG/src/main/java/LLSIG/App.java
  9. 8
      LLSIG/src/main/java/LLSIG/Canvas.java
  10. 26
      LLSIG/src/main/java/LLSIG/LLSIG.java

@ -1,11 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="C:/Users/sigon/eclipse-workspace/LLSIG/lib/jlayer-1.0.1.jar"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

@ -10,8 +10,14 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>

@ -0,0 +1,4 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8

@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=false

@ -1,12 +1,16 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.source=1.7

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

@ -37,4 +37,5 @@ if(/COMMIT_EDITMSG/g.test(commitMessage)){
}
EOF
chmod +x .git/hooks/prepare-commit-msg
cd LLSIG
echo "Environment is setup!"

@ -1,13 +0,0 @@
package main.java.LLSIG;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}

@ -16,12 +16,12 @@ public class Canvas extends JPanel{
public void paintComponent(Graphics g) {
final int MIDDLE_X = this.getWidth()/2;
final int MIDDLE_Y = this.getHeight()/8;
final int NOTE_DISTANCE = 128;
final int MIDDLE_Y = this.getHeight()-(this.getWidth()/2);
final int JUDGEMENT_LINE_WIDTH = 64;
final int JUDGEMENT_LINE_HEIGHT = 4;
final int NOTE_SIZE = 16;
final int NOTE_SIZE = 96;
final int LANE_SPACING_X = 100;
final int NOTE_DISTANCE = (int)(LLSIG.WINDOW_SIZE.width/2)-NOTE_SIZE;
super.paintComponent(g);
if (LLSIG.game!=null) {
@ -35,7 +35,7 @@ public class Canvas extends JPanel{
g.setColor(Color.GRAY);
//g.fillRect(MIDDLE_X-JUDGEMENT_LINE_WIDTH/2+LANE_X_OFFSET,MIDDLE_Y-JUDGEMENT_LINE_HEIGHT/2,JUDGEMENT_LINE_WIDTH,JUDGEMENT_LINE_HEIGHT);
g.fillOval((int)(MIDDLE_X-Math.cos(Math.toRadians(22.5*i))-16),(int)(MIDDLE_Y+Math.sin(Math.toRadians(22.5*i))-16),32,32);
g.fillOval((int)(MIDDLE_X-Math.cos(Math.toRadians(22.5*i))*NOTE_DISTANCE-NOTE_SIZE/2),(int)(MIDDLE_Y+Math.sin(Math.toRadians(22.5*i))*NOTE_DISTANCE-NOTE_SIZE/2),NOTE_SIZE,NOTE_SIZE);
g.setColor(NOTE_COLOR);
Lane lane = LLSIG.game.lanes.get(i);

@ -3,11 +3,8 @@ import java.awt.Dimension;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@ -15,7 +12,6 @@ import java.util.regex.Pattern;
import javax.swing.JFrame;
import javazoom.jl.decoder.JavaLayerException;
import main.java.sig.utils.FileUtils;
public class LLSIG implements KeyListener{
@ -33,18 +29,22 @@ public class LLSIG implements KeyListener{
final static Dimension WINDOW_SIZE = new Dimension(1024,800);
public boolean EDITMODE = true;
public boolean PLAYING = false; //Whether or not a song is loaded and playing.
LLSIG(JFrame f) {
this.window = f;
this.musicPlayer = new Player("music/"+song+".mp3");
musicPlayer.play();
for (int i=0;i<9;i++) {
lanes.add(new Lane(new ArrayList<Note>()));
}
LoadSongData("MiChi - ONE-315959669",lanes);
PLAYING = new File("music/"+song+".mp3").exists();
if (PLAYING) {
this.musicPlayer = new Player("music/"+song+".mp3");
musicPlayer.play();
LoadSongData("MiChi - ONE-315959669",lanes);
}
Canvas canvas = new Canvas(f.getSize());
window.add(canvas);
window.setVisible(true);
@ -126,10 +126,10 @@ public class LLSIG implements KeyListener{
case KeyEvent.VK_K:{lane=6;}break;
case KeyEvent.VK_L:{lane=7;}break;
case KeyEvent.VK_SEMICOLON:{lane=8;}break;
case KeyEvent.VK_P:{if (musicPlayer.isPaused()) {musicPlayer.resume();} else {musicPlayer.pause();}}break;
case KeyEvent.VK_Q:{musicPlayer.pause();SaveSongData("music/"+song+".sig",lanes);}break;
case KeyEvent.VK_P:{if (LLSIG.game.PLAYING&&musicPlayer.isPaused()) {musicPlayer.resume();} else {musicPlayer.pause();}}break;
case KeyEvent.VK_Q:{if (LLSIG.game.PLAYING) {musicPlayer.pause();SaveSongData("music/"+song+".sig",lanes);}}break;
}
if (lane!=-1) {
if (LLSIG.game.PLAYING&&lane!=-1) {
LLSIG.game.lanes.get(lane).addNote(new Note(NoteType.NORMAL,musicPlayer.getPlayPosition()));
}
//System.out.println("Pressed "+e.getKeyChar()+" on frame "+musicPlayer.getPlayPosition());

Loading…
Cancel
Save