Files
citizen/citizen.pde

87 lines
2.1 KiB
Plaintext

Citizen mensch;
//debug settings
boolean b_smallerImage = true; //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...
void mouseClicked(){
mensch.goTo(73);
}
class Citizen{
int i_xSpawn, i_ySpawn, i_xPos, i_yPos, i_diameter;
boolean b_linked;
int i_home;
// berufsfeld: webdesigner, pädagoge, schmuckdesigner, schmied
// berufsstatus: beamter, selbstständiger, unternehmer, angestellter, grundschüler, gymnasiast, hauptschüler, realschüler, azubi, student, rentner
// identität: gelbhemd, lokal, regional, national, international, fremd,
//names of pathfinding algorithms: greedy best first search, uniform cost search, a star search
Citizen(int home){
i_home = home;
i_diameter = 15;
}
void goTo(int house){
println("want to go to house " + house);
}
void spawn(int house){
PVector v2_spawnPoint = spawnAreas.get(house).v2_randomSpawnPoint();
i_xSpawn = int(v2_spawnPoint.x);
i_ySpawn = int(v2_spawnPoint.y);
i_xPos = i_xSpawn;
i_yPos = i_ySpawn;
b_linked = true;
}
void despawn(){
b_linked = false;
}
void display(){
ellipse(i_xPos, i_yPos, i_diameter, i_diameter);
}
}
void setup() {
size(400, 300);
fill(0);
//ft = new SimpleDateFormat ("HH:mm:ss");
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"));
initHouses();
blendMode(MULTIPLY);
surface.setSize(img_houses.width, img_houses.height);
initWeather();
mensch = new Citizen(112);
mensch.spawn(112);
}
void draw() {
background(255);
image(img_houses, 0, 0, img_houses.width, img_houses.height);
//image(img_streets, 0, 0, img_houses.width, img_houses.height);
textSize(7);
textAlign(CENTER);
for (SpawnArea spawn : spawnAreas) {
spawn.display();
}
mensch.display();
UI();
}