Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var pionek = function() {
- fill(255, 0, 0);
- rect(x,y,10,10);
- if (keyIsPressed && keyCode === LEFT) {
- x = x - 1;
- }
- if (keyIsPressed && keyCode === RIGHT) {
- x = x + 1;
- }
- if(keyIsPressed && keyCode === UP&&y>162) {
- y = y - 1;
- }
- if(keyIsPressed && keyCode === DOWN) {
- y = y + 1;
- }
- if (x+10 === 10 && y+10 === 50) {
- x = 0 ;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement