This site requires JavaScript, please enable it in your browser!
Greenfoot back
DesignerOrb362
DesignerOrb362 wrote ...

2014/11/30

How can i create a order-based scoreb

DesignerOrb362 DesignerOrb362

2014/11/30

#
i am working on a racing game and i have a looping track that i want to create a score for, from 1st place to 3rd place, as well as laps, I was planning on using the finishing/starting line as a checkpoint for laps but I don't know how to do that and I don't know if its even possible to create a 1st-3rd, any help?
danpost danpost

2014/11/30

#
If you have a looping track, then it stands to reason the your vehicles will be turning. If you track the total amount that each one turns, then you can place them in order, from highest to lowest, by the amount of turning (or change in rotation of the actor) they did. If you needed laps run, you can divide the total amount of rotation by 360.
Super_Hippo Super_Hippo

2014/11/30

#
If you only evaluate the number of laps by the sum of the rotation, then you could turn without driving the track and it is still handled as laps. Maybe you could add checkpoints which every car has to pass in the correct order to finish one lap. (It is possible to create a scoreboard which shows the best 3.)
danpost danpost

2014/11/30

#
Super_Hippo wrote...
If you only evaluate the number of laps by the sum of the rotation, then you could turn without driving the track and it is still handled as laps.
Yeah, I had thought about that -- like the vehicle spinning out of control racking up the lap count. I did not think that would be an issue here (though, I could be wrong). Using checkpoints is a good idea, however (just more code to deal with).
You need to login to post a reply.