start
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
/nix/store/w1db6kd959lj74biy3mhhs7qfafr8srs-nix-shell-env
|
||||||
File diff suppressed because it is too large
Load Diff
+42
@@ -0,0 +1,42 @@
|
|||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
|
||||||
|
|
||||||
|
void setup(){
|
||||||
|
size(800,800);
|
||||||
|
rectMode(CENTER);
|
||||||
|
}
|
||||||
|
|
||||||
|
void draw(){
|
||||||
|
rect(x, y, 50, 50);
|
||||||
|
}
|
||||||
|
void keyPressed()
|
||||||
|
{
|
||||||
|
if (key == CODED)
|
||||||
|
{
|
||||||
|
if (keyCode == LEFT)
|
||||||
|
{
|
||||||
|
//if (directionX>0) {
|
||||||
|
x--;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
else if (keyCode == RIGHT)
|
||||||
|
{
|
||||||
|
//if (directionX<0) {
|
||||||
|
x++;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
else if (keyCode == UP)
|
||||||
|
{
|
||||||
|
//if (directionY<0) {
|
||||||
|
y--;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
else if (keyCode == DOWN)
|
||||||
|
{
|
||||||
|
//if (directionY<0) {
|
||||||
|
y++;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user