This commit is contained in:
Antoine 2021-05-31 19:48:42 +02:00
parent aa06c55dd7
commit a069067c9c
2 changed files with 21 additions and 21 deletions

View File

@ -1,22 +1,22 @@
package configuration;
import java.io.*;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
public class JsonToJava {
public static void main(String args[]) {
JSONParser jsonP = new JSONParser();
try {
JSONObject jsonO = (JSONObject)jsonP.parse(new FileReader("src/configuration/config.json"));
String test = (String) jsonO.get("test");
System.out.println("Name :"+ test);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace();
}
}
}
//import java.io.*;
//import org.json.simple.JSONObject;
//import org.json.simple.parser.JSONParser;
//import org.json.simple.parser.ParseException;
//public class JsonToJava {
// public static void main(String args[]) {
// JSONParser jsonP = new JSONParser();
// try {
// JSONObject jsonO = (JSONObject)jsonP.parse(new FileReader("src/configuration/config.json"));
// String test = (String) jsonO.get("test");
// System.out.println("Name :"+ test);
// } catch (FileNotFoundException e) {
// e.printStackTrace();
// } catch (IOException e) {
// e.printStackTrace();
// } catch (ParseException e) {
// e.printStackTrace();
// }
// }
//}

View File

@ -175,7 +175,7 @@ public class Engine {
soundManager.setListener(soundListener);
SoundBuffer jumpSoundBuffer = new SoundBuffer("sound/jump.ogg");
SoundSource soundSource = new SoundSource(true, false);
SoundSource soundSource = new SoundSource(false, false);
soundSource.setBuffer(jumpSoundBuffer.getBufferId());
soundManager.addSoundSource("jump", soundSource);