Game Development Community

Getting Started

by Jared Kidd · in Technical Issues · 09/29/2008 (4:03 pm) · 3 replies

Ok i'm going through the getting started tuorial and i'm at the part where you type this code into the logoitem.cs

//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------

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();
%logo.count=logos.getCount();
if(%logo.Count > 0)
return;

commandToClient(%client,'Show Victory',%client.score);
}
}

can someone tell me why it doesn't make my score go up. i can collide with them and they'll disappear, but can't get my score to go up please help

About the author

i'm 16 and i really enjoy making games and testing them. i started making games when i was 11 using game maker, but then i started using torque when i was about 13 and now i fell in love with game designing and look forward to making a career out of it.


#1
09/29/2008 (4:16 pm)
Do you have a function for the client called SetScoreCounter(%clientScore)? You're incrementing the client's score, but you also have to make sure the function to update the displays based upon it you're calling actually exist.
#2
09/29/2008 (4:58 pm)
I don't think i do how do i make that function
#3
10/03/2008 (6:03 am)
Hi
i just get the torque game builder,and i want to make a game script but were do i start?
have no knowledge of game script is ther a good book i can read, ihave look in the tut of garagegames but they tel liitel a bout the code zo plz can sombody help me?