Skip to content

Instantly share code, notes, and snippets.

@jikkujose
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jikkujose/da9424a6256ab6652ea4 to your computer and use it in GitHub Desktop.
Save jikkujose/da9424a6256ab6652ea4 to your computer and use it in GitHub Desktop.
class SittingDuck
include Robot
def tick events
turn_radar 5 if time == 0
fire 3 unless events['robot_scanned'].empty?
turn_gun 10
@last_hit = time unless events['got_hit'].empty?
if @last_hit && time - @last_hit < 20
accelerate(1)
else
stop
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment