Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Horse Race Game...
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
dymd3z




PostPosted: Mon May 07, 2007 8:01 am   Post subject: Horse Race Game...

I'm trying to make a little game of watching 5 horses race. I need each race to be at random, so the x variable must change during each race. Problem is I'm not sure how to get it to do that for each process I made for the horses. Anyone have any ideas? Here is what I have so far:

var x : int := 0
var horse1 : int := Pic.FileNew ("horse1.bmp")
var horse2 : int := Pic.FileNew ("horse2.bmp")
var horse3 : int := Pic.FileNew ("horse3.bmp")
colourback (black)

process first
loop
cls
x := x + 5
Pic.Draw (horse1, x, 10, picMerge)
delay (100)
Draw.FillBox (x, 10, x + 32, 42, black)
x := x + 5
Pic.Draw (horse2, x, 10, picMerge)
delay (100)
Draw.FillBox (x, 10, x + 32, 42, black)
x := x + 5
Pic.Draw (horse3, x, 10, picMerge)
delay (100)
Draw.FillBox (x, 10, x + 32, 42, black)
end loop
end first

process second
loop
cls
x := x + 5
Pic.Draw (horse1, x, 80, picMerge)
delay (100)
Draw.FillBox (x, 80, x + 32, 112, black)
x := x + 5
Pic.Draw (horse2, x, 80, picMerge)
delay (100)
Draw.FillBox (x, 80, x + 32, 112, black)
x := x + 5
Pic.Draw (horse3, x, 80, picMerge)
delay (100)
Draw.FillBox (x, 80, x + 32, 112, black)
end loop
end second

process third
loop
cls
x := x + 5
Pic.Draw (horse1, x, 160, picMerge)
delay (100)
Draw.FillBox (x, 160, x + 32, 192, black)
x := x + 5
Pic.Draw (horse2, x, 160, picMerge)
delay (100)
Draw.FillBox (x, 160, x + 32, 192, black)
x := x + 5
Pic.Draw (horse3, x, 160, picMerge)
delay (100)
Draw.FillBox (x, 160, x + 32, 192, black)
end loop
end third

process fourth
loop
cls
x := x + 5
Pic.Draw (horse1, x, 240, picMerge)
delay (100)
Draw.FillBox (x, 240, x + 32, 272, black)
x := x + 5
Pic.Draw (horse2, x, 240, picMerge)
delay (100)
Draw.FillBox (x, 240, x + 32, 272, black)
x := x + 5
Pic.Draw (horse3, x, 240, picMerge)
delay (100)
Draw.FillBox (x, 240, x + 32, 272, black)
end loop
end fourth

process fith
loop
cls
x := x + 5
Pic.Draw (horse1, x, 320, picMerge)
delay (100)
Draw.FillBox (x, 320, x + 32, 352, black)
x := x + 5
Pic.Draw (horse2, x, 320, picMerge)
delay (100)
Draw.FillBox (x, 320, x + 32, 352, black)
x := x + 5
Pic.Draw (horse3, x, 320, picMerge)
delay (100)
Draw.FillBox (x, 320, x + 32, 352, black)
end loop
end fith

fork first
fork second
fork third
fork fourth
fork fith
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: