Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. public void move(int direction, int amount){
  2. for(int i = 0; i<amount; i++){
  3. if(direction == 0 && !collision(direction))
  4. x --;
  5. else if(direction == 1 && !collision(direction))
  6. x ++;
  7. else if(direction == 2 && !collision(direction))
  8. y --;
  9. else if (direction ==3 && !collision(direction))
  10. y++;
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement