float y=0.0;
float x=0.0;
void setup(){
size(400,400);
smooth();
PImage menu;
menu=loadImage("menu.png");
image(menu,0,0);
frameRate(100);
}
void draw(){
if (key == 'a'){
PImage a;
a=loadImage("a.png");
image(a,0,0);
x+=15;
y+=15;
PImage airplane;
airplane=loadImage("airplane.png");
image(airplane,18+x,192-y);
if (x > width)
if (y > height) {
x = 0;
y = 0;
}
}
if (key == 'b'){
PImage b;
b=loadImage("b.png");
image(b,0,0);
x+=15;
y+=15;
PImage balloons;
balloons=loadImage("balloons.png");
image(balloons,320,98-y);
if (x > width)
if (y > height) {
x = 0;
y = 0;
}
}
if (key == 'c'){
PImage c;
c=loadImage("c.png");
image(c,0,0);
x+=15;
y+=15;
PImage cow;
cow=loadImage("cow.png");
image(cow,167+x,190-y);
if (x > width)
if (y > height) {
x = 0;
y = 0;
}
}
if (key == 'd'){
PImage d;
d=loadImage("d.png");
image(d,0,0);
x+=15;
y+=15;
PImage dragon;
dragon=loadImage("dragon.png");
image(dragon,105+x,132-y);
if (x > width)
if (y > height) {
x = 0;
y = 0;
}
}
if(key == 'e'){
PImage e;
e=loadImage("e.png");
image(e,0,0);
x+=15;
y+=15;
PImage elephant;
elephant=loadImage("elephant.png");
image(elephant,95+x,149+y);
if (x > width)
if (y > height) {
x = 0;
y = 0;
}
}
}
Exercise E
on Monday, Apr 20, 2009 – 8:12 pm