Race Game Results

KickingBehindsKickingBehinds Member, PRO Posts: 49
edited December 2011 in Working with GS (Mac)
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

Comments

  • sparkersparker Member Posts: 47
    What exactly is it that your wanting to do? Ie, can you be more specific. If your just wanting to save times, create an actor that saves what the time that each car passes the finish?

    Sam
  • KickingBehindsKickingBehinds Member, PRO Posts: 49
    edited December 2011
    Sorry, I want to record which car finishes first, which car finishes second and so on. The depending on when the car finishes, they will receive a different prize (but at this stage I just want to work out how to record their placings).

    Thanks,

    SC
  • sparkersparker Member Posts: 47
    Personally, I'd save the times now - it would come in handy down the track I'm sure. Plus you can easily work out who finished in what order by the times recorded.

    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
  • KickingBehindsKickingBehinds Member, PRO Posts: 49
    That's great thanks, I will give it a go!

    Thanks again.
Sign In or Register to comment.