Declaring and Relating a Variable
by rennie moffat · in Torque Game Builder · 11/24/2009 (3:06 pm) · 0 replies
Hi there, before I start I want to say sorry @all, esp @william. I did not mean to sound snappy. I think I had been staring at the computer too long and my brain had stopped working. I punched in mAbs into search and found my answer this morning, when yesterday, as I say I must have been too tired because I could not find it. Anyhow, new day, new dollar!
I am studying the Breakout Tutorial, in it, the programmer has used a isPlaying call for his %trail.
%speed it is true,&& speed is less than 5
he then sets it to false.
and if false and speed over 5 he sets it to true, but sets playEffect to false. I am confused about this as isn't playEffect() enough to use in this case? What is the purpose of the isPlaying bool?
I am studying the Breakout Tutorial, in it, the programmer has used a isPlaying call for his %trail.
$thebase.myTrail.isplaying=true;
////but he also has this line. also in onLevelLoaded baseClass
%trail.playEffect(false);
///later in the baseClass onTimer() he uses these in the function as
function baseClass::onTimer(%this)
{
%speed = getword(%this.getlinearVelocitypolar(),1);
if ( (%this.myTrail.isplaying==true) && (%speed < 5) )
{
%this.myTrail.stopEffect(true,false);
%this.myTrail.isplaying=false;
} else if ( (%speed > 5) && (%this.myTrail.isplaying==false) )
{
%this.myTrail.playeffect(false);
%this.myTrail.isplaying=true;
}
}my confusion is, what is he using the isPlaying for? %speed it is true,&& speed is less than 5
he then sets it to false.
and if false and speed over 5 he sets it to true, but sets playEffect to false. I am confused about this as isn't playEffect() enough to use in this case? What is the purpose of the isPlaying bool?
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.