Game Development Community

need help

by Alexis Rojas Fernandez · in Torque Developer Network · 03/07/2009 (2:59 pm) · 0 replies

I just followed this tutorial tdn.garagegames.com/wiki/Beginner/Torque_Intro#Graphical_User_Interface_.28GUI.2... but the problem I am having is that when i touch the logo the score doesnt change, please can someone tell me what i am doing wrong , thanks in advance.

-------this is what i have for logoitem.cs(server)--------


datablock StaticShapeData(TorqueLogoItem)
{
category = "Items";
shapeFile = "~/data/shapes/3dtorquelogo/torque_logo.dts";
};
function TorqueLogoItem::onCollision(%this, %obj, %col)
{ if(%col.getClassName() $= "Player")
{
%client = %col.client;
%client.score++;
commandToClient(%client, 'SetScoreCounter', %client.score);
%obj.delete();
%logoCount = logos.getCount();
if(%logoCount > 0)
return;
// otherwise display victory screen
commandToClient(%client, 'ShowVictory', %client.score);
}
}


----This is what I have for clientGame.cs-------


function clientCmdSetScoreCounter(%score)
{ ScoreCounter.setText("Score:" SPC %
score);
}
function clientCmdShowVictory(%score)
{ MessageBoxYesNo("You Win!",
"Would you like to restart the game ?",
"loadMyMission();",
"quit();");
}