class Rubots::Samples::Artillery
Points at a target and fires a single shot.
Public Class Methods
new(map, me, targets)
click to toggle source
# File lib/rubots/samples/artillery.rb, line 5 def initialize(map, me, targets) @fired = false end
Public Instance Methods
command(me, targets)
click to toggle source
# File lib/rubots/samples/artillery.rb, line 9 def command(me, targets) if me.angle != 90 rotate_to 90 elsif me.gun_angle != targets.first.angle rotate_gun_to targets.first.angle else fire end end
name()
click to toggle source
# File lib/rubots/samples/artillery.rb, line 19 def name "Artillery" end