I'm writing a horse race/bet game using Shoes and I was wondering how I would be able to change the GUI in different areas of code. When I run this, I get the horse on one application and then the race line on another application, but I want them both on the same application. Do I need to set the actual Shoes app as a variable itself?
class Horse
def initialize()
#puts "YOYOYOYO"
#@number=i
Shoes.app{
@icon= image 'horsey.jpg'
@icon.left = 100
@icon.top = 50
}
end
def neigh()
#puts "Neighhhh"
end
def raceTime()
time=rand(100)%20
return time+10
end
end
class HorseIcon
def initialize(h)
@horse= h
@imageloc='horsey.jpg'
end
end
class Game
def initialize(h1, h2)
contestants=[h1, h2]
Shoes.app{
@icon= image 'raceline.jpg'
@icon.left = 100
@icon.top = 70
}
end
def race()
end
end
game= Game.new(1,2)
seabiscuit= Horse.new()