Race Game Results
Hi all,
I am making a racing game, however I am having trouble developing a system to record the results (who finishes first, second, third etc). There was a thread about this earlier but I can't seem to be able access it anymore.
Can anyone provide any help or point me in the direction of where to find out how to do this?
Any help would be greatly appreciated.
Thanks,
SC
I am making a racing game, however I am having trouble developing a system to record the results (who finishes first, second, third etc). There was a thread about this earlier but I can't seem to be able access it anymore.
Can anyone provide any help or point me in the direction of where to find out how to do this?
Any help would be greatly appreciated.
Thanks,
SC
Comments
Sam
Thanks,
SC
So, basically have a real for each car. Save the time into the corresponding real as each car finishes. Then sort the times using a min or max function.
Alternatively, if you just want the order. Create a set of integers (first, second, third and forth). When a car finishes, check to see if "first" is greater than zero, if it is, check to see if "second" is greater than zero, etc. Basically use the same set of rules for each car, but the nested if statement will allow you to save the car numbers in order.
It will check to see if first has been recorded, if not - save it there. If first has been recorded, check to see if second has been recorded. If not, save there. If it has as well, check to see if third has been recorded etc.
Catch the drift?
Sam
Thanks again.