Score
by Fucifer · in Torque Game Builder · 05/24/2006 (5:29 pm) · 7 replies
I did search but found very limit information, is there any info how to setup score in TGB. I just want shoot and kill something and get a score.
#2
05/25/2006 (8:19 am)
I try that but does not work with Beta 4. Maybe i doing something wrong. Can you give me some details of how you got to work.
#3
As in 100 points for killing x and maybe 350 points for killing y, total score 450 points?
The way I do this is assign everything its score value at it's creation (ie %obj.killscore = 500;). Then when it's destroyed do something like this:
If this is what you mean, hope it helps if not sorry ;)!
05/25/2006 (9:58 am)
You mean you want to keep a total score, with everything you kill adding to it? As in 100 points for killing x and maybe 350 points for killing y, total score 450 points?
The way I do this is assign everything its score value at it's creation (ie %obj.killscore = 500;). Then when it's destroyed do something like this:
if (%obj.killscore) { $currentscore = $currentscore + %obj.killscore;}If this is what you mean, hope it helps if not sorry ;)!
#4
05/25/2006 (1:35 pm)
I hope to get base score. The playership shoot the enemyship and 1 is add to score each time you kill the enemyship. I am probably missing something simple but scent I had brain operation a year ago, I get stump on somethings and you cant figure them out.
#5
When your enemy ship is destroyed all you need to do is increase a variable by one. That variable is then effectively your score, and you can do what you want. An example would be:
If any of these principles are not clear, then i'd recommend (re?) running through the base tutorial. If you have any more questions then feel free to post away :)
05/25/2006 (4:19 pm)
OK,When your enemy ship is destroyed all you need to do is increase a variable by one. That variable is then effectively your score, and you can do what you want. An example would be:
function YourEnemyDestroyedFunction
{
//Your current code that gets run when an enemy is destroyed
//%obj.safedelete(); for example
$score = $score + 1;
}
function EchoScore
{
echo($score);
}If any of these principles are not clear, then i'd recommend (re?) running through the base tutorial. If you have any more questions then feel free to post away :)
#6
05/27/2006 (3:33 pm)
I would like to say thank you to everyone who help me. Oustanding community. Thank you again. With the help I got I went back to the draw board and rewrote my score code. Now everything is working real good. I have it, where it add one to the score if you kill the enemy and if he kill you it subtract one from the score. Thanks again.
#7
05/28/2006 (9:17 am)
No problems mate :)
Torque Owner Don Hogan