Are we All agree?
Hi all
It's better to use :
"CHANGE Attribute OLDtime to SELF.TIME
THEN a RULE :
IF SELF.TIME = OLDtime+2
Then Do i want etc.."
THAN :
"TIMER : Every 2 sec
Do i want etc."
Better performance with 1st case? anyone agree?
thanks guys
It's better to use :
"CHANGE Attribute OLDtime to SELF.TIME
THEN a RULE :
IF SELF.TIME = OLDtime+2
Then Do i want etc.."
THAN :
"TIMER : Every 2 sec
Do i want etc."
Better performance with 1st case? anyone agree?
thanks guys
Comments
Someone who really knows please comment.
if self.time = oldtime+2>>
>>do whatever you want
then place this inside the rule as well
>>Change attribute oldtime= self.time.
and the cycle goes on & on & on.
drahc : Are you agree that is better than "TIMER every 2sec?"
how do input "oldtime" as an expression. Do I just type "oldtime"?
Cheers
Not sure if its actually better than a timer or not?
Thanks stormystudio
The best way to do it is :
****************************
create an attribute - integer - call it "temp timer" - value:0
Rule:
when "temp timer" = Self.time%2
Do what you want
****************************
This method will not have the"run to completion" option , so you should consider that as well !
Roy.
Just to understand so the self.time%2 is equal to 0 every 2 seconds right?
So self.time%0.3 will be equal to 0 every 0.3 seconds i guess.
Wow great! thanks
Glad it helped you
Roy.
In the same way, is there a "clean" method to replace the "TIMER : After X seconds" do what i want... ?
Rob2 is that what you're proposing?
Create 2 new attributes - spawner (integer 2), temptime (integer 0)
when temptimer = self.time%game.ptspawn (ptspawn basically updates to be eqaul to self.time every 8 seconds)
change attribute spawner-0.1
when spawner = self.time%spawner
--spawn whetever I want every 2 seconds then decreasing in time by 0.1 seconds every 8 seconds--
Would this work or am I completely lost?
EDIT- Just realised the flaw would be that the 8 second timer would increase by 8 every 8 seconds...
How would I essentially set up a spawn timer that decreased the spawn time of enemies either based upon time or score?
So let's resume :
Create an attribute "SpawingDelay" = 2
create a temp= 0
then you do a rule WHEN "temp=Self.time%SpawningDelay" spawn my enemy.
After that if you want a rule to decrease your spawning time, just do something like :
Rule : WHEN "temp=self.time%30"
change attribute : SpawningDelay = SpawningDelay - 0.1
if this case, every 30seconds you minus 0.1 sec to the spawning Delay.
maybe it's exclatly what you said. at least it's a confirmation