Actors spawn faster

Hello,

I have 4 different Actors in my game that spawn to random Times (between 5-10seconds) at a random location.

I also have a score, after 100 points on the Score i want the Actors to spawn every 3-7 seconds. How do i do this?

I made an Actor called 'Spawner' and 4 Timers

Timer - Every (random 5, 10) spawn Actor 1
at Location (random)

Timer - Every (random 5, 10) spawn Actor 2
at Location (random)

And so on

I made an attribute called score

Then in Actor 1,2,3,4 I made one Rule each

Rule - Collision - When Actor 1 collides with Platform 1
Change attribute game.score to game.score +1

This works perfectly, just now I want to increase the spawn rate of my Actors the longer the game goes on (or the higher the score is)

Comments

  • wcsd9739wcsd9739 Member Posts: 37

    You could try creating two attributes, something like minSpawnInterval and maxSpawnInterval, and for your timers use Every [random(self.minSpawnInterval,self.maxSpawnInterval)].

    At first have the attributes set to 5 and 10, and then have rules to control them:

    If game.Score > 100, game.Score < (next change value): set self.minSpawnInterval to 3, set self.maxSpawnInterval to 7

  • TitchTitch Member Posts: 8

    Thank you for your answer, unfortunately I have seen it to late but fixed my Problem like this:

    I created another Spawn Actor and dragged it outside my Game Screen on the initial Screen

    I used my previously set Attribute 'score' that counted the score of the game

    I created a Rule if Attribute score is higher than 50, then I created a Timer every random 2,6 sec spawn Actor 1

    So if you got a Score higher than 50 the Actor would spawn more frequently

Sign In or Register to comment.