deleted duplicate
This commit is contained in:
@@ -1,124 +0,0 @@
|
||||
import processing.net.*;
|
||||
|
||||
|
||||
//settings
|
||||
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_cameraFollow = true;
|
||||
boolean b_autoPlayAfterSelect = false;
|
||||
|
||||
|
||||
boolean b_controlEyeWithMouse;
|
||||
|
||||
|
||||
boolean b_debug = true;
|
||||
boolean b_drawNodes = false;
|
||||
|
||||
float f_nodeResolution = 0.2; //defines density of path-finding nodes, multiplied with resolution
|
||||
int i_pathAlgorithm = 3;
|
||||
int i_debugTextSize = 10;
|
||||
int i_mapW, i_mapH;
|
||||
int i_windowW, i_windowH;
|
||||
int i_viewportW, i_viewportH;
|
||||
|
||||
//void mousePressed() {
|
||||
// citizen[0].goTo(constrain(mouseX, 0, img_houses.width), constrain(mouseY, 0, img_houses.height));
|
||||
//}
|
||||
|
||||
void spawnCitizen() { //happens after construction
|
||||
}
|
||||
|
||||
Server server;
|
||||
Client client;
|
||||
|
||||
|
||||
void setup() {
|
||||
size(700, 600);
|
||||
server = new Server(this, 5210);
|
||||
//blendMode(MULTIPLY);
|
||||
i_windowW = width;
|
||||
i_windowH = height;
|
||||
img_map = loadImage(dataPath("map/map.png"));
|
||||
if (b_smallerImage) img_houses = loadImage(dataPath("map/houses_with_borders_small.png"));
|
||||
else img_houses = loadImage(dataPath("map/houses_with_borders.png"));
|
||||
img_streets = loadImage(dataPath("map/streets.png"));
|
||||
|
||||
pg_map = createGraphics(img_houses.width, img_houses.height);
|
||||
pg_map.beginDraw();
|
||||
//pg_map.blendMode(MULTIPLY);
|
||||
pg_map.endDraw();
|
||||
|
||||
|
||||
surface.setResizable(true);
|
||||
registerMethod("pre", this);
|
||||
|
||||
i_mapW = pg_map.width;
|
||||
i_mapH = pg_map.height;
|
||||
|
||||
initHouses();
|
||||
initPathFinding();
|
||||
initWeather();
|
||||
initCitizen();
|
||||
initInteractables();
|
||||
initUI();
|
||||
}
|
||||
|
||||
void pre() {
|
||||
if (i_windowW != width || i_windowH != height) {
|
||||
// Sketch window has resized
|
||||
i_windowW = width;
|
||||
i_windowH = height;
|
||||
i_uiY = height - i_uiH;
|
||||
i_uiW = width;
|
||||
i_uiH = height - i_uiY;
|
||||
}
|
||||
}
|
||||
String s_fromClient;
|
||||
int i_mapLevelTransferC;
|
||||
void draw() {
|
||||
background(127);
|
||||
clientCommunication();
|
||||
|
||||
pg_map.beginDraw();
|
||||
pg_map.background(127);
|
||||
|
||||
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);
|
||||
//pg_map.image(img_houses, 0, 0, img_houses.width, img_houses.height);
|
||||
//image(img_streets, 0, 0, img_houses.width, img_houses.height);
|
||||
|
||||
pg_map.fill(0);
|
||||
pg_map.textSize(7);
|
||||
pg_map.textAlign(CENTER);
|
||||
//for (House house : houses) {
|
||||
// house.display();
|
||||
//}
|
||||
|
||||
if (b_drawNodes) drawNodes();
|
||||
|
||||
for (int i = 0; i < interactables.length; i++) {
|
||||
interactables[i].update();
|
||||
interactables[i].display();
|
||||
}
|
||||
|
||||
for (int i = 0; i < citizen.length; i++) {
|
||||
if (citizen[i].b_linked) {
|
||||
citizen[i].update();
|
||||
if (i != i_selectedCitizen)
|
||||
citizen[i].display();
|
||||
if (b_debug)
|
||||
citizen[i].debug();
|
||||
}
|
||||
}
|
||||
|
||||
if (b_controlEyeWithMouse) {
|
||||
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();
|
||||
|
||||
pg_map.endDraw();
|
||||
image(pg_map, i_mapOffsetX, i_mapOffsetY, i_mapW, i_mapH);
|
||||
drawUI();
|
||||
}
|
||||
Reference in New Issue
Block a user