Creating endless rounds of enemies with timing
So I have a single enemy character that comes into scene and then increases its speed towards the player. I want to be able to create endless rounds of these enemies with about 3 to 4 seconds of a gap in between, like a breather, and increasing acceleration in every round.
I created a real attribute called gamerealtime and increased by 1 second every real second. In the enemy actor, I used that to spawn enemy actor for 12 seconds and then stop from 13 to 16 seconds. That was one rule, with an increase in linear velocity in X axis from -100 to -210. Second rule, increased speed to -240 and so on.
I have used a trigger to spawn and not-spawn enemy character. Boolean attribute called spawnenemy. Spawn actor is separate and hidden. In enemy actor, the attribute spawn enemy is triggered on in all the individual rules. For example, a rule named speed -210 will have: When gamerealtime is lessthan/equalto 12 and greaterthan/equalto 0, do changeattribute spawnenemy to true, timer every 0.3 secs changeattribute self.motion.linearvelocity.x to self.mot.... - 210.
The last part sort of brings the enemy in slow and then accelerates all of a sudden to the player.
The problem is, my rounds aren't working. The boolean is set to true initially. The first round spawns (-210), and the second round does (-240), third round and so on do not. I cannot figure out why.
Need help figuring this out.