Game Development Community

Water Guns

by Dylan Sale · in Torque Game Engine · 07/09/2002 (2:40 am) · 3 replies

Ok. I have been trying to get this to work for a while now. Basically what I want to do is add support for water guns like super soakers etc. Alt-Fire would pump up the gun and then fire would shoot a stream of water. I figured that this would need to have changes made to the game code in the SDK.

I can't figure out a good way of doing this though. I started by copying the Projectile files, and then editing them.

Initially, I added a linked list of points in the stream(a new class I created). Then I changed the rendering code to render lines from each of the points to the next one, and the physics code to iterate through all the points, modifying their position every tick.

It worked sorta. The stream is created when fire is pushed and the physics code works. (I tested it using breakpoints).

The problem I face is that the rendering code is not getting called and I cant figure out how to change the firing code to add a new point to the list in the stream rather then creating a new stream when the fire button is held down. I know that this is done in the scripting though.

I have tried to explain my problem, but i dont think i have done a good job. If any one knows how to or have tried to do this then PLEASE email me.

Dylan Sale

#1
07/09/2002 (2:58 am)
Hm, I guess the best thing would be to post your code somewhere so that others might look into it to see what may be the problem....
#2
07/09/2002 (3:05 am)
I'll do that. i just need to clean it up a bit though... Im only really a beginner though and it'll probably look like a real mess anyway. :) I'll post where i put it a bit later.

Thanks for the reply.
#3
07/09/2002 (6:19 am)
hmmm. The code is more of a mess tahn i thought. I think I'll just redo it. thanks for sounding interested anyways...

Cya

Dylan Sale