//345 lines String[] danger; String[] semidanger; float[] xpos; float[] ypos; float[] xpos1; float[] ypos1; float[] bsize; float[] bsize2; int[] ycrash; int[] ycrash2; int amd; int amd2; int index=0; int counter=0; //counts dangerous intersections int counter2=0; //counts semi-dangerous intersections PFont SFont; PImage m; PImage[] p; //array of image PImage s; PImage r; PImage b; PImage bike; boolean ind=false; int id; void setup(){ size(564,564); SFont=loadFont("AmericanTypewriter-48.vlw"); id=3; //makes bike default danger=loadStrings("red.txt"); amd=danger.length; semidanger=loadStrings("green.txt"); amd2=semidanger.length; p=new PImage[5]; ycrash=new int[amd]; ycrash2=new int[amd]; xpos=new float[amd]; ypos=new float[amd]; bsize=new float[amd]; xpos1=new float[amd2];//2nd array ypos1=new float[amd2]; bsize2=new float[amd2]; bike=b; for (int i=0; i= 258) { stroke(258); } else { stroke(accident[i]); } line(i, 0, i, height); }*/ // PImage(p,accident[i]); background(m); noStroke(); } void draw(){ background(m); fill(255,255,255); rect(470,500,80,50); fill(255,255,255); rect(380,500,80,50); fill(255,0,0); image(p[id],mouseX-20,mouseY-40); for (int i=0; ixpos[i]-3 && mouseXypos[i]-3 && mouseYxpos[i]-3 && mouseXypos[i]-3 && mouseY