float x, y;
void setup() {
size(440, 440);
}
void draw() {
background(177, 201, 234);
ellipse(x,y,20,20);
fill (70, 104, 153);
}
void keyPressed() {
if (keyCode == LEFT) {
x = x - 5;
}
if (keyCode == RIGHT){
x = x 5;
}
if (keyCode == UP) {
y = y - 5;
}
if (keyCode == DOWN){
y = y 5;
}
}
void setup() {
size(440, 440);
}
void draw() {
background(177, 201, 234);
ellipse(x,y,20,20);
fill (70, 104, 153);
}
void keyPressed() {
if (keyCode == LEFT) {
x = x - 5;
}
if (keyCode == RIGHT){
x = x 5;
}
if (keyCode == UP) {
y = y - 5;
}
if (keyCode == DOWN){
y = y 5;
}
}
Vastaukset
Vanhimmat
Ei vielä vastauksia
Aloittaja odottaa vastauksia. Kerro oma näkemyksesi ensimmäisenä.