Game Development Community

Creating" a bullet

by Mick Orbik · in Torque Game Builder · 01/07/2008 (2:27 pm) · 3 replies

Alright... Since my other post was answered pretty quickly, I will try my luck with posting an actual programming question. I am trying to make a simple shooting control system. What I want to do is have W,S,A,D move the characters in their respective cardinal directions (North, South, West, East) and then use the mouse to aim the character. So I need to have events rigged up for MouseMove and MouseButtonDown events (don't know if thats what these are called in torque, but what I need in general). So thats part 1 of my question.

The other part, is how would I "create" the sprite of the bullet. Like in the Create panel of the actual TGB program, I have say a static sprite of the bullet. How would I place a specific one into the world? Like, %bullet = new t2dSprite() or something.

Please forgive me if the question has been answered previously, I tried to search, but I found not a lot. Keep in mind, this is my first time using TorqueScript, although I do have 7 years of C++ experience under my belt. It seems simple enough, but as with any new language, it requires a learning curve, and I am just starting up the first part :).

#1
01/07/2008 (2:39 pm)
I would recommend going through the behavior playground. They will answer your mouse aim and shooting questions!
#2
01/07/2008 (3:17 pm)
That looks exactly like what I need. Does the behavior playground come with the TGB Demo for 30 days, or do you download it seperately, or is it again, a TDN exclusive?
#3
01/07/2008 (9:55 pm)
I think it comes with the demo.