// määritellään kuvat muuttujiksi PImage taustakuva; PImage pelihahmo; int x = 450; int y = 100; void setup(){ // asetetaan piirtokankaan koko size(900,625); //Määritellään piirtoalueen koko // asetetaan ruudunpäivitysnopeus frameRate(60); taustakuva = loadImage("forrest.jpg"); //Määritetään kuvia pelihahmo = loadImage("bird.png"); } void draw(){ background(taustakuva); image(pelihahmo, x, y); } void keyPressed(){ if (keyCode == LEFT){ x = x - 10; } if (keyCode == RIGHT){ x = x + 10; } if (keyCode == UP){ y = y - 10; } if (keyCode == DOWN){ y = y + 10; } }