merged branches locally, clean up

This commit is contained in:
2019-01-22 11:45:48 +01:00
parent d27b72fbe8
commit b1ed7e0608

View File

@@ -1,3 +1,6 @@
import processing.net.*;
//settings //settings
boolean b_smallerImage = false; //use a cropped, smaller version of the 1920x1080 image for faster development boolean b_smallerImage = false; //use a cropped, smaller version of the 1920x1080 image for faster development
boolean b_loadSun = false; //load sun from web-api instead of local json file (local file is adressed to january 4th 2019. might implement a check that downloads today's information only once... boolean b_loadSun = false; //load sun from web-api instead of local json file (local file is adressed to january 4th 2019. might implement a check that downloads today's information only once...
@@ -6,6 +9,10 @@ boolean b_loadSun = false; //load sun from web-api instead of local json file (l
boolean b_cameraFollow = true; boolean b_cameraFollow = true;
boolean b_autoPlayAfterSelect = false; boolean b_autoPlayAfterSelect = false;
boolean b_controlEyeWithMouse;
boolean b_debug = true; boolean b_debug = true;
boolean b_drawNodes = false; boolean b_drawNodes = false;
@@ -21,12 +28,15 @@ int i_viewportW, i_viewportH;
//} //}
void spawnCitizen() { //happens after construction void spawnCitizen() { //happens after construction
} }
Server server;
Client client;
void setup() { void setup() {
size(700, 600); size(700, 600);
server = new Server(this, 5210);
//blendMode(MULTIPLY); //blendMode(MULTIPLY);
i_windowW = width; i_windowW = width;
i_windowH = height; i_windowH = height;
@@ -65,14 +75,16 @@ void pre() {
i_uiH = height - i_uiY; i_uiH = height - i_uiY;
} }
} }
String s_fromClient;
int i_mapLevelTransferC;
void draw() { void draw() {
background(127); background(127);
clientCommunication();
pg_map.beginDraw(); pg_map.beginDraw();
pg_map.background(127); pg_map.background(127);
if(b_debug) pg_map.image(img_houses, 0, 0, img_houses.width, img_houses.height); if (b_debug) pg_map.image(img_houses, 0, 0, img_houses.width, img_houses.height);
else pg_map.image(img_map, 0, 0, img_houses.width, img_houses.height); else pg_map.image(img_map, 0, 0, img_houses.width, img_houses.height);
//pg_map.image(img_houses, 0, 0, img_houses.width, img_houses.height); //pg_map.image(img_houses, 0, 0, img_houses.width, img_houses.height);
//image(img_streets, 0, 0, img_houses.width, img_houses.height); //image(img_streets, 0, 0, img_houses.width, img_houses.height);
@@ -96,14 +108,14 @@ void draw() {
citizen[i].update(); citizen[i].update();
if (i != i_selectedCitizen) if (i != i_selectedCitizen)
citizen[i].display(); citizen[i].display();
if(b_debug) if (b_debug)
citizen[i].debug(); citizen[i].debug();
} }
} }
citizen[i_selectedCitizen].v2_direction.x = citizen[i_selectedCitizen].f_xPos - (float)constrain(i_mapViewToMap(mouseX, i_mapOffsetX), 0, pg_map.width); if (b_controlEyeWithMouse) {
citizen[i_selectedCitizen].v2_direction.y = citizen[i_selectedCitizen].f_yPos - (float)constrain(i_mapViewToMap(mouseY, i_mapOffsetY), 0, pg_map.height); citizen[i_selectedCitizen].turnTo(citizen[i_selectedCitizen].f_xPos-(float)constrain(i_mapViewToMap(mouseX, i_mapOffsetX), 0, pg_map.width), citizen[i_selectedCitizen].f_yPos-(float)constrain(i_mapViewToMap(mouseY, i_mapOffsetY), 0, pg_map.height), 0) ;
}
citizen[i_selectedCitizen].display(); citizen[i_selectedCitizen].display();
pg_map.endDraw(); pg_map.endDraw();