Archive for March, 2010

TGB Level Loader

March 15, 2010

So working with a new board selection class for La Box and I came across a nice little piece of code for loading levels. This is not my code and I don’t remember whose it is but it works wonders for me.
function loadNewLevel(%levelFile, %delay)
{
// Prevents a crash
if (%delay $= “”) %delay = 100;
// If [...]

Posted in Code Snippets Comments Off

Dynamic Position Particle Effects

March 10, 2010

So when I was working on some of the power ups for La Box I needed a way to display several particle effects on the screen at the same time. So what i did was create a function to do this for me.
function CreateGroundPountEffect(%pos)
{
%particle = new t2dParticleEffect();
%particle.addToScene($sceneGraph);
%particle.loadEffect(”~/data/particles/SmokePuff.eff”);
%particle.Position = %pos;
%particle.playEffect();
}
Use this function and pass in the [...]

Posted in Code Snippets Comments Off

TGB Audio Setup

March 10, 2010

Here is a sample audio setup class for torque game builder. Simply create a new script file. Add in the following.
new AudioDescription(AudioNonLooping)
{
volume = 1.0;
isLooping = false;
isStreaming = true;
};
new AudioDescription(AudioLooping)
{
volume = 1.0;
isLooping = true;
isStreaming = true;
};
new AudioProfile(AudioSpaceBass)
{
filename = “~/data/audio/SpaceBass.wav”;
description = “AudioLooping”;
preload = true;
};
Execute the script in game.cs. then use alxPlay(AudioSpaceBass); anywhere you want to play the [...]

Posted in Code Snippets Comments Off

FL Studio 9 Export

March 10, 2010

Hey All. So I was working on generating some background music for La Box and using FL Studio 9. Well with torque game builder I came across something interesting. If you try to export your wav file on any settings other than the default FL Studio 9 export setting you get nothing but static. Might [...]

Posted in Updates Comments Off