Game Development Community

shooter behaviour

by rennie moffat · in Torque Game Builder · 06/22/2009 (11:13 am) · 3 replies

hi I am having some trouble understanding what characteristics , more specifically, the code which I need to plug into my behaviors field areas.


Attached in a demo shooter behavior. what I am wondering, is the text areas where things are declared, which is any parts are the parts left untouched, in other words, how much of those variables is self input-able. I am having a bit of trouble of REALLY grasping which each of those elements are. in terms of image used, rates etc. How which one goes where.


[c]
%template.addBehaviorField(projectile, "The projectile to clone and shoot", object, "", t2dSceneObject);
%template.addBehaviorField(fireKey, "The key to fire the projectile with", keybind, "keyboard space");
%template.addBehaviorField(fireRate, "The rate to fire when the fire key is held down (seconds)", float, "0.25");
%template.addBehaviorField(projectileSpeed, "The speed of projectiles (world units per second)", float, "150");
[/c]

About the author

My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.


#1
06/22/2009 (11:49 am)
PS.
I noticed that in a non scroller, a behavior is used to control the player. In all Scrollers that I have seen they do not use Behaviors. IS there a significant reason for this?





#2
06/22/2009 (4:10 pm)
The games potentially were just started before or during TGB 1.5, where no behaviours were present or the devs just don't like behaviours and do it the traditional way :)
#3
06/22/2009 (4:23 pm)
ok so would it be safe to say the best way (arguable) but a useable way to create behaviours for an object is to do it thru addBeahaviours then.



That being said, any one point me in the right direction RE: a player shooting. I am working with code from tuts, but any insight is always welcome.

Mainly, how a movable object (player) will always fire weapons from same point relative to itself. I know its in there somewhere, but if anyone has a quick answer PuhLEASE tell meh.