Game Development Community

Problem with TGB 1.6.0

by Dessy · in Torque Game Builder · 04/17/2008 (4:37 pm) · 0 replies

Hi

I don't if this post is clasified here so it doesn't matter if my post is moved to another section in forums, if it is please let me know.

Well I've followed the Asteroid tutorial and I found a problem. I found this problem in section 3 where I got to add some behaviors (displayScore.cs and scorePoints.cs). I could add displayScore.cs behavior file to Behaviors tab without a problem but the other behavior file named scorePoints.cs is the only I CAN'T add it to behavior tab. How could I fix this issue?

source code is this:

//-----------------------------------------------------------------------------
// Torque Game Builder
// Copyright (C) GarageGames.com, Inc.
// Behavior by Mike Lilligreen for TDN Asteroids Tutorial
//-----------------------------------------------------------------------------

if (!isObject(ScorePointsBehavior))
{
%template = new BehaviorTemplate(ScorePointsBehavior);

%template.friendlyName = "Score Points";
%template.behaviorType = "Game";
%template.description = "Gives the object a point value for scoring purposes";

%template.addBehaviorField(pointValue, "How much the object is worth", int, 10);
%template.addBehaviorField(counter, "The score counter object", object, "", t2dSceneObject);
}

function ScorePointsBehavior::onRemoveFromScene(%this, %scenegraph)
{
%counter = %this.counter.getBehavior("DisplayScoreBehavior");
if (!isObject(%counter))
return;

$currentScore = $currentScore + %this.pointValue;
%counter.updateScore();
}

I hope you can help me

see ya'

About the author

Recent Threads