Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (31 sloc) 520 Bytes
int x, y; // 円の座標
void setup() {
size(960, 540);
pixelDensity(displayDensity());
noStroke();
fill(0);
x = width/2;
y = height/2;
}
void draw() {
background(255);
if (keyPressed) {
// ↑のとき
if (keyCode == UP) {
y -= 4;
}
// ↓のとき
else if (keyCode == DOWN) {
y += 4;
}
// ←のとき
else if (keyCode == LEFT) {
x -= 4;
}
// →のとき
else if (keyCode == RIGHT) {
x += 4;
}
}
ellipse(x, y, 50, 50);
}