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:
31
lib/simulator/field.rb
Normal file
31
lib/simulator/field.rb
Normal file
@@ -0,0 +1,31 @@
|
||||
module TAC
|
||||
class Simulator
|
||||
class Field
|
||||
def initialize(container:, season:, robot:)
|
||||
@container = container
|
||||
@season = season
|
||||
@robot = robot
|
||||
|
||||
@position = CyberarmEngine::Vector.new
|
||||
@scale = CyberarmEngine::Vector.new(1, 1)
|
||||
@size = 0
|
||||
end
|
||||
|
||||
def draw
|
||||
Gosu.clip_to(@position.x, @position.y, @size, @size) do
|
||||
Gosu.draw_rect(@position.x, @position.y, @size, @size, Gosu::Color::GRAY)
|
||||
# Gosu.scale(@scale.x, @scale.y) do
|
||||
Gosu.translate(@position.x, @position.y) do
|
||||
@robot.draw
|
||||
end
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@position.x, @position.y = @container.x, @container.y
|
||||
@size = @container.width
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user