Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (28 sloc) 566 Bytes
require 'gosu'
require 'clock_hand'
class BackHand < Hand
end
class MeridianHand < Hand
end
class FaceHand < Hand
end
class MsecHand < Hand
def set_angle
self.angle = (360.0/1000) * (time.usec/1000.0)
end
end
class SecondHand < Hand
def set_angle
self.angle = (360.0/60) * (time.sec + (time.usec/1000.0/1000.0))
end
end
class MinuteHand < Hand
def set_angle
self.angle = (360.0/60) * (time.min + time.sec/60.0)
end
end
class HourHand < Hand
def set_angle
self.angle = (360.0/12) * ((time.hour % 12) + time.min/60.0)
end
end
Something went wrong with that request. Please try again.