Posted: Fri May 27, 2005 9:25 pm Post subject: Scoring System
My scoring system is a bit buggy. I do a reset but it still seems to continue on where it left off. Here's the jist of the code.
code:
var scoreLevel : int := 50
var score : int :=0
if score >= scoreLevel %ready to enter next level
then cls %clears the screen for the scoring updates
%scoring system (after each completed level)
put "Your score is: ", score %score with out additional time bonus
var bonus:int:=60 %1 min to get bonus (bonus = 60000 milliseconds = 60 seconds =1 min)
var timeBonus:int :=bonus-Time.Elapsed div 1000 %1 min timer (Time.Elapsed = 1000 milliseconds = 1 min)
put "Your time bonus is: ", timeBonus %time bonus
score:=score+timeBonus %updated score = score as of to that point + time bonus
put "Your overall score is: ", score %score as of to that point + time bonus
put "[press enter to continue to next round]" %gives the user time to read the score
scoreLevel:=score+50 %next level will be completed after an additional 50 points
end if
Sponsor Sponsor
Mr. T
Posted: Fri May 27, 2005 10:17 pm Post subject: Alex's Opinion
YAY i solved the problem by myself... heres what i did.
code:
var score : int :=0 %score
var bonus:int:=60 %1 min
var scoreLevel : int := 50
if score >= scoreLevel
then cls %clears the screen for the scoring updates
%scoring system (after each completed level)
put "Your score is: ", score %score with out additional time bonus
var timeBonus:int :=bonus-Time.Elapsed div 1000 %1 min timer (Time.Elapsed = 1000 milliseconds = 1 min)
put "Your time bonus is: ", timeBonus %time bonus
score:=score+timeBonus %updated score = score as of to that point + time bonus
put "Your overall score is: ", score %score as of to that point + time bonus
bonus:=60+(Time.Elapsed div 1000) %bonus reset
put "[press enter to continue to next round]" %gives the user time to read the score
end if