Advertisement
Guest User

Untitled

a guest
Apr 14th, 2014
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. if(player.getColor() == '#f00')
  2. {
  3.  
  4. if (me.canMove('up'))
  5. {
  6. me.move('up');
  7. }
  8. else if(me.canMove('left'))
  9. {
  10. me.move('left');
  11. }
  12. else
  13. {
  14. player.setColor('#f0f');
  15. }
  16. }
  17. if(player.getColor() == '#f0f')
  18. {
  19. if(me.canMove('right'))
  20. {
  21. me.move('right');
  22. }
  23. else
  24. {
  25. me.move('down');
  26. }
  27. }
  28. else
  29. {
  30. if (me.canMove('down'))
  31. {
  32. me.move('down');
  33. }
  34. else if(me.canMove('right'))
  35. {
  36. me.move('right');
  37. }
  38. else
  39. {
  40. player.setColor('#f00');
  41. me.move('left')
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement