Created
February 3, 2015 13:17
-
-
Save davelooi/951b65486bca89e49b09 to your computer and use it in GitHub Desktop.
dave's RTanque
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DavidBot < RTanque::Bot::Brain | |
NAME = 'david_bot' | |
include RTanque::Bot::BrainHelper | |
def tick! | |
## main logic goes here | |
# use self.sensors to detect things | |
# See http://rubydoc.info/github/awilliams/RTanque/master/RTanque/Bot/Sensors | |
# use self.command to control tank | |
# See http://rubydoc.info/github/awilliams/RTanque/master/RTanque/Bot/Command | |
# self.arena contains the dimensions of the arena | |
# See http://rubydoc.info/github/awilliams/RTanque/master/frames/RTanque/Arena | |
command.fire_power = 1.5 | |
command.speed = (sensors.speed + 1.5) % 20 | |
command.heading = sensors.heading + BOT_RADIUS | |
command.turret_heading = sensors.turret_heading + BOT_RADIUS | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment