Skip to content

Instantly share code, notes, and snippets.

@fran6co
Last active December 28, 2015 20:09
Show Gist options
  • Save fran6co/7555528 to your computer and use it in GitHub Desktop.
Save fran6co/7555528 to your computer and use it in GitHub Desktop.
class SuperWallBot extends BaseRobot
onInit:() ->
@turnLeft(@heading % 90)
@turnTurretLeft(Infinity)
onIdle:() ->
toWall = null
if @heading == 0 or @heading == 180
toWall = @ahead(Math.max(@arenaSize.width - @x, @x) - 28)
else
toWall = @ahead(Math.max(@arenaSize.height - @y, @y) - 28)
toWall.then =>
@turnRight(90)
onScannedRobot:(event) ->
@fire(3)
tr = new SuperWallBot("Super Wall Bot")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment