mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-16 13:52:34 +00:00
Added semi-working simulator for estimating robot travel distances
This commit is contained in:
23
lib/simulator/robot.rb
Normal file
23
lib/simulator/robot.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
module TAC
|
||||
class Simulator
|
||||
class Robot
|
||||
attr_accessor :position, :angle
|
||||
def initialize(width:, depth:)
|
||||
@width, @depth = width, depth
|
||||
|
||||
@position = CyberarmEngine::Vector.new
|
||||
@angle = 0
|
||||
end
|
||||
|
||||
def draw
|
||||
Gosu.rotate(@angle, @position.x, @position.y) do
|
||||
Gosu.draw_rect(@position.x - @width / 2, @position.y - @depth / 2, @width, @depth, Gosu::Color::GREEN)
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@angle %= 360.0
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user