Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(player.getColor() == '#f00')
- {
- if (me.canMove('up'))
- {
- me.move('up');
- }
- else if(me.canMove('left'))
- {
- me.move('left');
- }
- else
- {
- player.setColor('#f0f');
- }
- }
- if(player.getColor() == '#f0f')
- {
- if(me.canMove('right'))
- {
- me.move('right');
- }
- else
- {
- me.move('down');
- }
- }
- else
- {
- if (me.canMove('down'))
- {
- me.move('down');
- }
- else if(me.canMove('right'))
- {
- me.move('right');
- }
- else
- {
- player.setColor('#f00');
- me.move('left')
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement