Sha256: 2d03d8e551064e83fe9dce6a83ed07d88f972992e7040bd811aa64d0fecd74e9

Contents?: true

Size: 346 Bytes

Versions: 3

Compression:

Stored size: 346 Bytes

Contents

require 'robot'

class SittingDuck
   include Robot

  def tick events
    drop_mine if rand(100) == 50 
    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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
UG_RRobots-2.0 robots/SittingDuck.rb
UG_RRobots-2.2 robots/SittingDuck.rb
UG_RRobots-2.1 robots/SittingDuck.rb