0
@@ -15,8 +15,8 @@ require base_dir+'lib/racer'
0
require base_dir+'lib/units/base'
0
require base_dir+'lib/units/standard'
0
require base_dir+'lib/secsy_time'
0
-Kernel::require Dir.pwd+'/lib/serialport.so'
0
-require base_dir+"lib/sensors/#{options['sensor']['file']}_sensor"
0
+#Kernel::require Dir.pwd+'/lib/serialport.so'
0
+require base_dir+"lib/sensors/#{options['sensor']['type']}_sensor"
0
SENSOR_LOCATION = options['sensor']['device']
0
RACE_DISTANCE = options['race_distance'].meters.to_km
0
RED_WHEEL_CIRCUMFERENCE = options['roller_circumference']['red'].mm.to_km
0
def initialize(shoes_instance, distance, update_area)
0
@shoes_instance = shoes_instance
0
- blue = @shoes_instance.ask "Who is on the blue bike?"
0
- red = @shoes_instance.ask "Who is on the red bike?"
0
+# blue = @shoes_instance.ask "Who is on the blue bike?"
0
+# red = @shoes_instance.ask "Who is on the red bike?"
0
@red = Racer.new(:wheel_circumference => RED_WHEEL_CIRCUMFERENCE,
0
@@ -85,10 +85,10 @@ class Race
0
@shoes_instance.rect 60, 340, red_progress, 20
0
if @blue.distance>RACE_DISTANCE and @red.distance>RACE_DISTANCE
0
winner = (@red.tick_at(@race_distance)<@blue.tick_at(@race_distance)) ? "RED" : "BLUE"
0
- @shoes_instance.title "#{winner} WINS!!!\n", :align => "center",
0
- :top => 380, :width => 800
0
+ @shoes_instance.title "#{winner} WINS!!!\n", :align => "center",
0
+ :top => 380, :width => 800
0
@shoes_instance.title "red: #{@red.tick_at(@race_distance)}, blue: #{@blue.tick_at(@race_distance)}",
0
-
:align => 'center', :top => 450, :width => 800
0
+
:align => 'center', :top => 450, :width => 800
0
Shoes.app :width => 800, :height => 600 do
0
- banner TITLE, :align => "center"
0
+ image "track.jpg", :top => -450
0
+ banner TITLE, :top => 150, :align => "center", :background => magenta
0
@update_area = stack {}
Comments
No one has commented yet.