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

2013/4/19

Adding a Scoreboard Please Help!!!

kronos524 kronos524

2013/4/19

#
So I'm a little new to Greenfoot, and in school, we need to make this car game, where there's three different classes. One is the car you control, one is the cars that come down the road, and the other are the lines on the road, to create an illusion of the car moving along the road. You're supposed to So what i want to do is add a scoreboard that adds ten points every second you survive. How would I do that?
danpost danpost

2013/4/19

#
A 'Counter' class whose value is controlled from the class of the 'car you control' using the difference between the 'current system time' and the 'initial system time' (times one hundred if using 'System.currentTimeMillis()') should do it.
kronos524 kronos524

2013/4/19

#
Okay, thank you so much!
danpost danpost

2013/4/19

#
I meant 'divided by one hundred', not 'times one hundred'. Actually, in pseudo-code, it would be: the current_score is ten times the integer value of ( (the current_time minus the initial_time) divided by one_thousand)
kronos524 kronos524

2013/4/20

#
Yeah, I've got it working now, thanks!
You need to login to post a reply.