Game Development Community

dev|Pro Game Development Curriculum

Score Reset: Introductory Tutorial

by Jason T · 03/07/2006 (11:16 am) · 1 comments

So it was killing me that the score would not reset after I collected all the torque logos from the Introductory Tutorial Missoin.

Cause:
When you won the mission you are asked 'Play again' or 'Exit'. If you chose Play Again your Score would start at '5' (or however many logosyou had out in your Logo SimGroup).

Only way to reset your score is to destroy the server by completely exiting Torque.

Solution:
Add a single line of code to reset the score at the top of each game.

open C:\Torque\SDK\example\GameOne\server\game.cs
find
function onMissionEnded()
{
on a new line just after "{" add
ScoreCounter.setText("Score:" SPC 0);

which is just before
// Called by loadMission() once the mission is finished loading.
}

and your done. Now, no matter what you say, Yes or No, the score will be reset back to '0'.

easy easy.

About the author

Recent Blogs