Game Development Community

Updated Shooter Game Tutorial for TGB 1.7.3

by Seth Willits · in Torque Game Builder · 05/17/2008 (12:13 am) · 22 replies

Good grief. Took me all day today and several hours yesterday.
tdn.garagegames.com/wiki/TGB/BasicTutorial1
Page«First 1 2 Next»
#21
07/30/2009 (1:22 am)
and the score...could you give me a hint?
actually, this is the main problem! it seems that the shooter coding is not working with some of the behaviors from the resorces! but I know that Seth Willits , by his tutorial haven´t used behaviors on it. And I really like his clean coding way! It´s very easy to understand.

Marc your hint about the invincibility I have tested...but I am dealing with a problem on the player.cs = function PlayerShip::explode(%this)
I think this function is not letting me use the :

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

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

and the invincibility...i think because they used on their behaviors (parameters like -> ) onRemoveFromScene and not explode(%this) like Seth did. as these 2 codes are not matching each other I really liked to know this:

function ScorePointsBehavior::(WHAT DO I NEED TO PUT HERE TO REGISTER MY DESTROYED EnemyShip BY MY playerMissile)

I´d really apreciate if you guys could help me on this one!
is there a list with all the functions for TGB?
#22
06/18/2010 (2:29 pm)
I work at IGT in Las Vegas, and have to learn Torque. Anyway, I started the tutorial, and right from the very beginning the ship won't move. It tells you that in the main.cs you should take out the dot of the line to load the player.cs file.

Once you have located those, add this line of code right below it:

exec("./gameScripts/player.cs");

This line of code tells your game to load the code that is in the player.cs file when the game starts. NOTE: DELETE THE . in the // Exec game scripts line that is in the main.cs file... the plane won't fly with the little dot there!




Is this what the code should look like?

// Exec game scripts.
exec("./gameScripts/game.cs");
exec("/gameScripts/player.cs");
Page«First 1 2 Next»