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

View File

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