Will the game start to lag if the actors spawned don't get destroyed after off-screen?
winged_box
Member Posts: 52
The game will keep spawning new enemy, if I don't destroyed the spawned actor after it got off-screen will it lag the game after a long time?
Comments
Yes It most defently will happen.
GSINVENTION FREE TEMPLATES
My problem now is every time the actor got destroyed after off-screen my spawner won't spawn any more new enemies, this happened when i use timer with the After setting.
If I select 'Every' the game will continue to spawn it even after it got destroyed but even though I set the time to random(1,5) it will always spawn at the same interval not random.
Any advise for this?
That depends on the particular circumstances, actors are automatically killed once they stray more than 500 pixels away from the edge of the scene ('scene' not screen).
It sounds like you have your code set up incorrectly. We'd need to see that code to be able to diagnose the issue.
If you set an "every" timer to random(1,5) then it will get the random number only once at the start and then stick to that timing.
In your case what you could do is the following
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
"change attribute self.lasttime = game.time
< game.time-self.lasttime"
Wouldn't this make it equal to '0'?
"self.delay < game.time-self.lasttime
spawn something
change attribute self.delay = random(1,5)"
My self.delay will be (1,5) meaning it will never be <game.time-self.lastime.
How will this work?
Tried that method but it won't spawn any enemy.