Score

Game Editor comments and discussion.

Score

Postby SanDiego1 » Thu Oct 20, 2005 6:32 pm

I have a game where the player gets points for getting a question correct and loses points when the player gets the question wrong. If the player gets a question wrong at the very beginning of the game and loses 100 points, the score shows -99 (I know that is because the first number is a 0). Is there a way to fix this? Many thanks!
SanDiego1
 
Posts: 20
Joined: Wed Oct 12, 2005 1:08 am
Score: 0 Give a positive score

Postby makslane » Thu Oct 20, 2005 7:16 pm

Try this:

score -= 100;

if(score < 0) score = 0;
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby SanDiego1 » Thu Oct 20, 2005 7:53 pm

Thank you, Makslane.
SanDiego1
 
Posts: 20
Joined: Wed Oct 12, 2005 1:08 am
Score: 0 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest