TGB Level Loader

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 you haven’t included a directory then we’ll use the default
if (!isFile(%levelFile))
%levelFile = “game/data/levels/” @ %levelFile;

// Add on the extension if needed
%fileExtn = “.t2d”;
if (getSubStr(%levelFile, strlen(%levelFile) – strlen(%fileExtn), strlen(%fileExtn)) !$= %fileExtn)
%levelFile = %levelFile @ %fileExtn;

// Load the file if possible
$gameRunning=true;
$levelName=%levelFile;
if (isFile(%levelFile))
schedule(%delay, 0, “startGame”, %levelFile, %empty);
else
warn(”Level not found: ” @ %levelFile);
}

This always works nicely if you want to play some kind of particle effect or animation before you load a new level. just call it like this loadNewLevel(%scene, 5000);
Posted in Code Snippets by admin. Comments Off

Dynamic Position Particle Effects

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 position where you want it to display. For me this was a random point on the screen so i would have Smoke Puffs all over the place. Hope this helps someone.

Posted in Code Snippets by admin. Comments Off

TGB Audio Setup

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 music.

Posted in Code Snippets by admin. Comments Off

FL Studio 9 Export

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 want to keep that in mind for all you composers out there.

Posted in Updates by admin. Comments Off

La Box Website

the website for la box is up and running! check out the website to find out more information on the 2D strategy puzzle game!

VIEW THE OFFICIAL WEBSITE

Posted in La Box by admin. Comments Off

ISK 2.0

That’s right! it’s in the works. As more details are settled upon we will let you know!

Posted in Isometric Starter Kit by admin. Comments Off