// Food for the snakes class Egg{ Node n; Egg(){ n = null; while(n == null){ n = (Node)aStar.nodes.get((int)random(aStar.nodes.size())); if(!n.walkable){ n = null; } } } void draw(){ stroke(0); fill(50, 20, 20); pushMatrix(); translate(n.x(), n.y(), n.z()); box(cubeScale, cubeScale, cubeScale); popMatrix(); } }