Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int x, y;
- void setup(){
- size(640,480);
- x = width/2;
- y = height/2;
- }
- void draw(){
- background(0);
- if( keyPressed == true ){
- if( keyCode == LEFT ) x--;
- else if( keyCode == RIGHT ) x++;
- else if( keyCode == UP ) y--;
- else if( keyCode == DOWN ) y++;
- }
- ellipse(x, y, 5, 5);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement