Game Development Community

Whack-A-Mole

by Chris Harpan · in Torque Game Builder · 05/25/2007 (11:35 am) · 4 replies

I'm wondering has anyone gotten this tutorial to work lately?

I'm following the code given in the 1.13 version of TGBP and the first bit of code for the mouse events don't seem to work at all.

Any help from someone who has an updated tutorial would be greatly appreciated.


If no one can help with this, does anyone have a good tutorial for learning Torque Script. I do own GPGT and with all of the code snafu's in there, I just end up getting more confused on script than actually getting anyhere.

#1
05/31/2007 (10:30 am)
Which section of the tutorial are you having issues with? could you post your scripts.
#2
12/23/2007 (6:37 pm)
I just completed the tutorial and I having issues in a few areas.

1. The Hammer doesn't follow the cursor position

* I used the following script as directed in the tutorial and placed it my moleLevel.cs script:

function SceneWindow2D::onMouseMove(%this, %mod, %worldPosition)
{
moleHammer.setPosition(%worldPosition);
}


2. The tutorial ends abruptly and doesn't explain how to get the Gui working with the game.

* The tutorial doesn't instruct the user on how to display the number of times whacked, number of times
missed, and the amount of time left during gameplay.

* The tutorial doesn't instruct the user on how to get the gameplay to end after 60 seconds on their
desired amount of time nor does it ever display the text "Game Over" most likely because gamplay
never ends.

* When you load the mole art resources the background art doesn't load with the other resources.
Although the tutorial doesn't mention these assets the various assets don't load with the rest of the
resources:
1. Full background image
2. The wooden plank image
3. The "whack-a-mole" title art
4. The mole particle image map

* The tutorial doesn't explain the use of the mole particle image map which would of been an excellent
display of how to utilize particle in game and how to set them up.

* When I tried to name the mole hammer in the scripting rollout of the level editor it keeps renaming
the hammer as :"molehammer" instead of :"moleHammer". This may be the reason it affecting the
code but hammer animation code still works regardless of the script being changed to "molehammer"
or "moleHammer".

I understand that the other tutorials where cut short but this one being the final one makes it seem
that it should be the most complete of them all. I hope that all the information I gave helps please help me address these issues a.s.a.p. because I'm using the tutorial to help me and my partners get spun up in Torque. I am a TGB owner but this seem to be the most appropiate spot to display this issue. Thanks in advance, ~Glenn.
#3
12/26/2007 (10:44 am)
Hi Glenn,

I did go through the Whack-A-mole tutorial without having any problems with it, I'm using the last version of TGB, which one are you using? If you still have trouble with it send me your project and I look at it.
#4
12/26/2007 (5:52 pm)
Yeah I have the latest version as well.