diff --git a/CitizenClass.pde b/CitizenClass.pde index 271bef5..dda2074 100644 --- a/CitizenClass.pde +++ b/CitizenClass.pde @@ -7,7 +7,7 @@ void initCitizen() { //namen: ethuriel, nathaniel, loriel, samuel, aluriel, aleriel, thaliel, suriel, kaliel, //int[][] claireArray = { { 00, 2 }, { 1, 3} }; - citizen[0] = new Citizen(59, "Test", 0, 26); + citizen[0] = new Citizen(800, "Test", 0,27); citizen[1] = new Citizen(121, "Matze", 1, 28); citizen[2] = new Citizen(18, "Freddy", 1, 28); citizen[3] = new Citizen(59, "Korbi", 1, 28); diff --git a/Time.pde b/Time.pde index 274f270..f8d93bb 100644 --- a/Time.pde +++ b/Time.pde @@ -1,5 +1,5 @@ -//import java.util.Date; -//import java.text.SimpleDateFormat; +import java.util.Date; +import java.text.SimpleDateFormat; //Date date = new Date(); //SimpleDateFormat ft; //Calendar c = Calendar.getInstance(); diff --git a/UI.pde b/UI.pde index caa6bfe..1d0af93 100644 --- a/UI.pde +++ b/UI.pde @@ -47,8 +47,8 @@ void drawUI() { "Movement speed: " + round(citizen[i_selectedCitizen].f_movementSpeed*100), "Random Run: " + citizen[i_selectedCitizen].b_randomRun, " ", - "Global", - " ", + "Sunrise: " + S_sunrise, + "Sunset: " + S_sunset, "Autoplay: " + b_autoPlayAfterSelect, "Locked Camera: " + b_cameraFollow, //"Velocity: ", diff --git a/Weather.pde b/Weather.pde index ee4492d..b84c698 100644 --- a/Weather.pde +++ b/Weather.pde @@ -1,6 +1,9 @@ PVector v2_coordinates = new PVector(48.799337, 9.794482); //badmauer; x: latitude, y: longitude boolean b_isRaining; +String S_sunrise; +String S_sunset; +Date d_sunrise; void initWeather(){ @@ -10,7 +13,14 @@ void initWeather(){ JSONObject sun; if(b_loadSun) sun = loadJSONObject("https://api.sunrise-sunset.org/json?lat=" + v2_coordinates.x + " &lng=" + v2_coordinates.y); else sun = loadJSONObject(dataPath("weather/today.json")); - println(sun); + //println(sun); + if (sun == null) { + //println("JSONObject could not be parsed"); + } else { + JSONObject results = sun.getJSONObject("results"); + S_sunrise = results.getString("sunrise"); + S_sunset = results.getString("sunset"); + } }