Coin Collection Part 2
Contents
What is Torque 3D?
Torque is a game engine, it is not based on graphical drag ‘n’ drop elements like Unity thus it is not as easy to get into and understand. There is no ‘make game button’ in Torque; you need to have an understanding of how to code, so if you are an absolute beginner at programming and have never written even a simple program then this might not be the right guide to start with.
What can Torque do out of the box?
// Test
/* test */
// exec("./serverConnection.cs");
%a;
datablock StaticShapeData( Coin )
{
category = "TutorialObjects";
shapeFile = "art/shapes/items/kit/healthkit.dts";
};
function Coin::onCollision(%this, %obj, %col, %vec, %len)
{
%obj.delete();
$CoinsFound++;
if(Coins.getCount() <= 0)
{
commandToClient(%col.client, 'ShowVictory', $CoinsFound);
}
}
function clientCmdShowVictory(%score)
{
MessageBoxOK("You Win!",
"Congratulation you found" SPC %score SPC "coins!",
"disconnect();" );
}
function Coin::onCollision(%this, %obj, %col, %vec, %len)
{
%obj.delete();
$CoinsFound++;
if(Coins.getCount() <= 0)
{
commandToClient(%col.client, 'ShowVictory', $CoinsFound);
}
}
function clientCmdShowVictory(%score)
{
MessageBoxOK("You Win!",
"Congratulation you found" SPC %score SPC "coins!",
"disconnect();" );
}
function Coin::onCollision(%this, %obj, %col, %vec, %len)
{
%obj.delete();
$CoinsFound++;
}
function Coin::onCollision(%this, %obj, %col, %vec, %len)
{
%obj.delete();
$CoinsFound++;
}
function clientCmdShowVictory(%score)
{
MessageBoxOK("You Win!",
"Congratulation you found" SPC %score SPC "coins!",
"disconnect();" );
}
function clientCmdShowVictory(%score)
{
MessageBoxOK("You Win!",
"Congratulation you found" SPC %score SPC "coins!",
"disconnect();",
"disconnect();",
"echo(%a + %b);",
"disconnect();" );
}
if (%a < %b) {
echo(%a);
}
if (%a < %b) {
echo(%a);
}
| |