Februar 22, 2012
int maxImages = 4; int imageIndex = 0; PImage[] images = new PImage[maxImages]; void setup() { size(600, 600); for (int i = 0; i < images.length; i ++ ) { images[i] = loadImage( "bildklick" + i + ".jpg" ); } } void draw() { image(images[imageIndex],0,0); filter(THRESHOLD,0.5); } void mousePressed() { imageIndex = int(random(images.length)); }
//DRIVE BUNNY Car redCar; //Car blueCar; //objektname void setup() { size(400,400); redCar = new Car("bunny_03.jpg", width/2, height/2, 100, 100, 12); //blueCar = new Car("bunny_03.jpg", color(0,0,255), width/2, height/2, 20,20,10); } void draw() { background(0); redCar.display(); // mit punkt werden funktionen aufgerufen redCar.drive(); //blueCar.display(); //blueCar.drive(); }