Timed Enemy Pattern
by rennie moffat · in Torque Game Builder · 07/22/2009 (7:32 am) · 69 replies
Hi guys, today I will be working on a pattern timer for a scene object which will act like an enemy to my hero. It will simply turn on and off, when on, my hero can not cross it, move over it. When it is off he can. So I must develop some type of shield. which must be turned on and off. I of course want to take that and make it so that I could have several on screen at once which can then have there own timers on so that an object. our hero, must maneuver safely between. Think Mario Bros, when he has to time his run underneath the giant monoliths.
As I say I will be working on this today, research, piecing together code, but if anyone has any clue, tips prior, please don't hesitate to chirp in.
As I say I will be working on this today, research, piecing together code, but if anyone has any clue, tips prior, please don't hesitate to chirp in.
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.
#62
07/24/2009 (11:16 am)
ah forget it another track, easy.
#63
function MoveTowardBehavior::onUpdate(%this)
{
if (!isObject(%this.object))
return;
%this.owner.moveTo(%this.object.position, %this.speed);
}
for instance "moveTo". is this a base call? how do I know the list of all of these? research I guess eh?
07/24/2009 (11:19 am)
heres a good example.function MoveTowardBehavior::onUpdate(%this)
{
if (!isObject(%this.object))
return;
%this.owner.moveTo(%this.object.position, %this.speed);
}
for instance "moveTo". is this a base call? how do I know the list of all of these? research I guess eh?
#64
%template.addBehaviorField(ScaleMin, "Min Value that powerup can scale to", float, 0.5);
%template.addBehaviorField(ScaleMax, "Max Value that powerup can scale to", float, 2);
%template.addBehaviorField(ScaleAmount, "How much to scale each frame", float, 0.05);
}
these "ScaleAmount, .. and the rest ScaleX''s. Do these represent core commands? or are they dreamt up by the programmer as terms which are defined later. This is where I get confused.
:Blink.
07/24/2009 (11:35 am)
just another while your here hopefully.%template.addBehaviorField(ScaleMin, "Min Value that powerup can scale to", float, 0.5);
%template.addBehaviorField(ScaleMax, "Max Value that powerup can scale to", float, 2);
%template.addBehaviorField(ScaleAmount, "How much to scale each frame", float, 0.05);
}
these "ScaleAmount, .. and the rest ScaleX''s. Do these represent core commands? or are they dreamt up by the programmer as terms which are defined later. This is where I get confused.
:Blink.
#65
TDN for TGB
The sceneobject functions under reference there
Lots of info
Behavior fields are all not core commands. They're just variables for the behavior that will show up in the level editor. There are core commands for scaling though, that you'll see in those links.
07/24/2009 (11:42 am)
Yeah, moveTo is a base call - have you read all the documentation? There's an awesome list of all of them that's probably the most helpful thing for scripting.TDN for TGB
The sceneobject functions under reference there
Lots of info
Behavior fields are all not core commands. They're just variables for the behavior that will show up in the level editor. There are core commands for scaling though, that you'll see in those links.
#67
When I'm scripting, I always have a bunch of those links open, checking for what's available when I need to code something.
07/24/2009 (11:45 am)
No problem - sorry if that came off harsh :)When I'm scripting, I always have a bunch of those links open, checking for what's available when I need to code something.
#68
its just getting the detail down that has me stumped 90% of the time.
07/24/2009 (11:46 am)
no i understand the whole thing, I really do.its just getting the detail down that has me stumped 90% of the time.
#69
07/24/2009 (11:59 am)
now that i think of it I wouldnt mind a little blur.
Torque Owner rennie moffat
Renman3000
really tho, my questions are simple. I just need to know little bits and pieces, I'm very particular like that very simple, just details and expressing them.
I'm sure i will get it, just need some time.