import processing.opengl.*; World theWorld; Stage2D stage; Camera myCam; boolean button = false; void setup() { size(400,400,P3D); //setup a 3D output theWorld = new World (60, 60, 3, 200); // theWorld = new World (20, 20, 3, 4); stage = new Stage2D (theWorld.getWidth(), theWorld.getHeight(), 12); myCam = new Camera (theWorld.getWidth(), theWorld.getHeight(), stage.getCellSize()); PImage foodImage = loadImage("futter.jpg"); theWorld.initializeFields(foodImage); theWorld.initializeAnts(); /* for (int i=0; i<2; i++) { Ant dummyAnt = (Ant) theWorld.ants.get(i); dummyAnt.carryingFood = true; }*/ /* Field georg = (Field) theWorld.getField(5,5); println(georg.posY); println(georg.getNestSmell()); georg = (Field) theWorld.getField(30,30); georg.setFoodAmount(8); georg = (Field) theWorld.getField(31,30); georg.setFoodAmount(20); georg = (Field) theWorld.getField(30,29); georg.setFoodAmount(20); georg = (Field) theWorld.getField(29,30); georg.setFoodAmount(20); georg = (Field) theWorld.getField(12,30); georg.setFoodAmount(20);*/ } void draw() { lights(); myCam.useCam(); theWorld.renderAnts(); background(123); theWorld.displayAnts(); stage.drawStage(); //graph output of the stage } void mousePressed() { // button = true; } void mouseReleased() { button = false; } void mouseDragged() { if(mouseButton == LEFT) myCam.rotateFirstAxis(); else if(mouseButton == RIGHT) myCam.rotateSecondAxis(); else if(mouseButton == CENTER) myCam.zoom(); } void keyPressed() { if(key == 'p') theWorld.printSmell(); }