Torque X: Progress, Pics, and Free Code
by John Kanalakis · 10/26/2007 (4:10 pm) · 7 comments
For a several months now, I've been exploring Torque X and enjoying all that it has to offer. I've enjoyed the quick and productive results of coding in C#, the rich Torque X Framework, and the elegant simplicity of components. So far, I've created over a dozen or so mini-games with TorqueX; mostly rips of classic games like Missile Command, Breakout, PacMan, etc. These are usually prototype games that take a few hours to put together to try out a new concept.
A simple air assault game testing controller input, inventory, pickups, a radar control, and basic AI

Today, my focus was on working with the sound and XACT. I wanted to test the playback of different sounds, based on different buttons pressed. So, I thought it would be fun to explore the sound capabilities of XNA with a Guitar Hero-ish mini-game.
I purchsased Guitar Hero II for the Xbox 360, so I still have an Xplorer Guitar Controller hanging around. So why not. I spent about 6 hours on this little mockup. About an hour was spent creating the very weak graphics, about 2 hours playing around with Torque X Builder, about 30 minutes playing with XACT, and about 2 hours coding the guitar component.
The guitar's musical notes were recorded and provided by good friend Dave Avery.
A short video of the game running.
The code is pretty simple. Afterall, the Xplorer controller is just another Xbox gamepad. Putting the mini-game together came down to a few steps:
1. I created 5 notes off to the side as scene object templates with a Y velocity of +20.
2. Next, I created 5 spawners at the top, outside camera range.
3. The spawners are completely random between 1 and 2 seconds apart.
4. I have a simple scroller for the board also at Y +20.
5. I have 5 animated objects (frets) on the bottom that are supposed to animate when the strum happens (next task).
6. On top of the frets are 5 blank scene objects which have a T2DTriggerComponent attached that calls back into a method called ProcessFret().
7. The ProcessFret() method checks what buttons are currently pressed (setup in an input map). If the right keys are pressed while the note is inside the trigger area, then I delete the note (and then play a blast away particle effect)
8. The input map is bound to actions which check the fret buttons and strum button to playback the sound.
That's mostly it. This isn't meant to be an actual game, just a fun excuse to play with the Xplorer controller while learning more about the limits of XACT. This is more about praise to Torque X and its creators. The framework is so robust, it's fast and easy to build interesting things. Just imagine what we'll be able to do with Torque X 3D!
Anyone who wants the code can download it from here. You can play the mini-game, read through the code, open the .txscene in Torque X Builder. Have fun with it. I'm not able to take this code any further (I have way to much else to do.) But, I thought it would be fun to have a Galaga style game where your player (a rocker) is at the bottom and uses his guitar to zapp incoming attackers, coming from the top, with the right music notes.
John K.
A simple air assault game testing controller input, inventory, pickups, a radar control, and basic AI

Today, my focus was on working with the sound and XACT. I wanted to test the playback of different sounds, based on different buttons pressed. So, I thought it would be fun to explore the sound capabilities of XNA with a Guitar Hero-ish mini-game.
I purchsased Guitar Hero II for the Xbox 360, so I still have an Xplorer Guitar Controller hanging around. So why not. I spent about 6 hours on this little mockup. About an hour was spent creating the very weak graphics, about 2 hours playing around with Torque X Builder, about 30 minutes playing with XACT, and about 2 hours coding the guitar component.
The guitar's musical notes were recorded and provided by good friend Dave Avery.
A short video of the game running.
The code is pretty simple. Afterall, the Xplorer controller is just another Xbox gamepad. Putting the mini-game together came down to a few steps:
1. I created 5 notes off to the side as scene object templates with a Y velocity of +20.
2. Next, I created 5 spawners at the top, outside camera range.
3. The spawners are completely random between 1 and 2 seconds apart.
4. I have a simple scroller for the board also at Y +20.
5. I have 5 animated objects (frets) on the bottom that are supposed to animate when the strum happens (next task).
6. On top of the frets are 5 blank scene objects which have a T2DTriggerComponent attached that calls back into a method called ProcessFret().
7. The ProcessFret() method checks what buttons are currently pressed (setup in an input map). If the right keys are pressed while the note is inside the trigger area, then I delete the note (and then play a blast away particle effect)
8. The input map is bound to actions which check the fret buttons and strum button to playback the sound.
That's mostly it. This isn't meant to be an actual game, just a fun excuse to play with the Xplorer controller while learning more about the limits of XACT. This is more about praise to Torque X and its creators. The framework is so robust, it's fast and easy to build interesting things. Just imagine what we'll be able to do with Torque X 3D!
Anyone who wants the code can download it from here. You can play the mini-game, read through the code, open the .txscene in Torque X Builder. Have fun with it. I'm not able to take this code any further (I have way to much else to do.) But, I thought it would be fun to have a Galaga style game where your player (a rocker) is at the bottom and uses his guitar to zapp incoming attackers, coming from the top, with the right music notes.
John K.
About the author
John Kanalakis is the owner of EnvyGames, an independent game development studio in Silicon Valley that produces games and tools for Xbox 360, Windows, and the Web.
#2
10/27/2007 (3:36 am)
Glad to see someone activly using TX, dosent seem too many people around by the looks of it.
#3
John K.
10/27/2007 (8:51 am)
Thanks Dave and Henry. I just find it interesting how much faster it is to work in C# by aggregating components. Torque X is a great platform for quickly fleshing out game ideas and concepts into prototypes.John K.
#4
10/27/2007 (11:12 pm)
I wanna play the heli game - is that available?
#5
John K.
10/28/2007 (12:09 pm)
LOL ;) The helicopter game has been my sandbox for testing out components. I'll clean it up this week and post the code. John K.
#6
10/29/2007 (3:56 am)
Nice stuff! That heli screenshot makes me wanna play a demo! :-)
#7
10/29/2007 (11:48 am)
great work! 
Torque 3D Owner Dave Young
Dave Young Games