class FeedBo::TouchSensor

Public Instance Methods

draw(svg) click to toggle source
# File lib/feed_bo/touch_sensor.rb, line 4
def draw(svg)
  fs = Level::FIELD_SIZE.to_f
  svg.g transform: "scale(#{fs/100})" do
    svg.rect width: 10, height: 12, x: 92, y: 44, fill: 'red'
  end
end
touched?() click to toggle source
# File lib/feed_bo/touch_sensor.rb, line 11
def touched?
  @robot.hit_positions.any? { |p| @robot.level.position_blocked? p }
end