Is there a way I can reset my spawner timers every 3 seconds so that they don't have lag over time?
Skyler128
Member, PRO Posts: 10
Is there a way I can reset my spawner timers every 3 seconds so that they don't have lag over time?
It starts to lag after 15 seconds. Here is what I have.
Timer every 1.1 seconds
spawn actor ball1
Timer every 1.8 seconds
spawn actor ball2
timer every 0.7 seconds
spawn actor ball3
It starts to lag after 15 seconds. Here is what I have.
Timer every 1.1 seconds
spawn actor ball1
Timer every 1.8 seconds
spawn actor ball2
timer every 0.7 seconds
spawn actor ball3
Comments
Are they not spawning when expected? Try adding a Log Debugging Statement to each actor with "prec(game.Time,1)" in the expression editor. That will output the time the actor is spawned in tenths of a second. You'll need to open the Debugger window to see the output.
Do your ball actors have processor intensive rules (e.g. lots of constrains, spawns, particles, etc.)?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Its the frame rate that goes down, making it less and less responsive.
My actors have direction 0.0 horizontal position random(70,350)
and vertical position 30
Here is what the debugger said each time a ball is spawned
Log(Actor: spawnpoint): prec(game.Time,1)
According to your spawn rules above, you would have a maximum of about 44 actors after 15 seconds. That shouldn't be enough to make the game lag, but again it depends on each actors' rules. You don't say if the actors are moving but if they are, you might want to destroy them after they leave the screen boundary.
I'm not sure the debugger is going to be helpful since I misunderstood you but to get it to work properly, you have to click on the 'e' button to edit the expression and then select game.Time from the drop-down menu instead of typing it in.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Accelerate Direction 270
Acceleration 90
Rule
Actor receives event overlaps or collides with actor of type bird
spawn actor squish
destroy this actor
change attribute game.score to game.score+4
Rule
Actor receives event overlaps or collides with actor of type floor
destroy
destroy this actor
change attribute
change attribute game.HP game.HP-1
after they spawn a certain number of ball actors, everything slows down in the game.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User