by date
Torque X: Progress, Pics, and Free Code
Torque X: Progress, Pics, and Free Code
| Name: | John Kanalakis | ![]() |
|---|---|---|
| Date Posted: | Oct 26, 2007 | |
| Rating: | 4.0 out of 5 | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for John Kanalakis |
Blog post
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.
Recent Blog Posts
| List: | 05/26/08 - Torque X Builder 3D Update 05/04/08 - Torque X Book Completed 04/22/08 - Torque X Builder 3D Progress: The Axis Gizmo 04/07/08 - Development Journal for Torque X Builder 3D 03/31/08 - Torque X 2.0 Tutorials Updated 11/04/07 - A New Casual Game 10/26/07 - Torque X: Progress, Pics, and Free Code 12/25/06 - Rocket Commander XNA |
|---|
Submit your own resources!| Dave Young (Oct 26, 2007 at 23:13 GMT) |
| Henry Garle (Oct 27, 2007 at 10:36 GMT) |
| John Kanalakis (Oct 27, 2007 at 15:51 GMT) Resource Rating: 5 |
John K.
| Andy Hawkins (Oct 28, 2007 at 06:12 GMT) |
| John Kanalakis (Oct 28, 2007 at 19:09 GMT) Resource Rating: 5 |
John K.
| Martin Schultz (Oct 29, 2007 at 10:56 GMT) |
| Jonathon Stevens (Oct 29, 2007 at 18:48 GMT) |
You must be a member and be logged in to either append comments or rate this resource.



4.0 out of 5


