Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
Dan
Browse files Browse the repository at this point in the history
  • Loading branch information
danielthepope committed Jan 15, 2015
1 parent ec5f0be commit 3b446d8
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions bots/dan_cant_ruby.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
class MyDeadlyBot < RTanque::Bot::Brain
NAME = 'dan_cant_ruby'
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.speed = 2
# command.heading = sensors.heading + Math::PI / 32.0
command.heading = Math::sin((sensors.position.y + 1) / (sensors.position.x + 1)) * Math::PI * 2.0
#puts "#{sensors.position.x},#{sensors.position.y}"
# nearest = sensors.radar.min {|a,b| a.distance <=> b.distance}
# command.radar_heading = Math::PI / 8.0
command.turret_heading = sensors.turret_heading + 0.1 #Math::PI * 3.0 / 4.0
command.fire(0.1)
end
end

0 comments on commit 3b446d8

Please sign in to comment.