Jquery Countdown Script

So, I had the need the other day for one of those “if your page does not redirect in X seconds, click here” scripts where the X would count down.

here is a little piece of jquery i wrote to handle this.

Drop this is a script block

function countDown() {
var secs = $(”#secs”).html();
var newsecs = secs – 1;
if (newsecs >= 0) {
$(”#secs”).html(newsecs);
setTimeout(”countDown()”, 1000);
}
}
setTimeout(”countDown()”, 1000);

then in the body of your html drop in

<p>If the page does not redirect in <span id=”secs”>10</span> seconds, you may <a href=”/default.aspx”>click here</a> to continue.</p>

the script will look at the value inside the “secs” span and do a simple countdown starting with that value. Now, if you wanted the script to redirect after the countdown was complete simply change this line in the script file

if (newsecs >= 0) {
$(”#secs”).html(newsecs);

to this.

if (newsecs >= 0) {
$(”#secs”).html(newsecs);
else
window.location = “http://google.com”;

That’s all there is to it. pretty simple.

Posted in Code Snippets Jquery by admin. Comments Off

Hack-N-Slash Kit Annoucement

Hey Guys,
I’ve been getting a lot of requests about when the 3D Isometric Starter Kit will be coming back around and upgraded for T3D. For those of you that do not know the story, that kit was developed in partnership with another company. So, unfortunately the ISK will not be coming back.

However! I am currently developing the successor to that kit and will feature:

- Character Stats
- Experience
- Leveling System
- Character Customization
- Random Dungeons (a la Diablo)
- Point and Click movements and attacks
- Inventory
- Equip-able weapons and armor
- Melee and Ranged Combat

If you guys have any requested features you’d like to see added to the kit feel free to let me know.

No release date has been determined yet but I will keep you all updated on my progress.

Posted in Hack N Slack Kit Isometric Starter Kit Updates by admin. Comments Off

ISK Update

Some of you may have noticed that the Isometric Starter Kit for the Garage Games Torque engine is no longer available on their website. Let me explain the situation.

The ISK was developed in partnership with another company. The other company is who has the agreement with GarageGames for sale of the kit. However the company and I have a 50/50 split agreement on any royalties from the sale of the ISK. So, over the last 9 months this other company has been impossible to get in touch with. So, I had GarageGames remove the ISK from their website until I can get things sorted out with the other company. Once things get sorted out the Kit will once again be available for sale.

Sorry for the inconvenience and I am trying to get this matter resolved as quickly as possible.

Posted in Isometric Starter Kit Updates by admin. Comments Off

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