Recycle actors rather than spawning?
GamersRejoice
Member Posts: 817
Currently, my game allows you to spawn actors at the top of the screen and they fall down with accelerate. Right now it's just spawning as many actors as you press but I figure it may improve performance to just reuse like 15 actors over and over. I've looked all over the forums and I haven't been able to figure this out. Could I get some help on this one?
Comments
Ok so I got that to work only one problem, now it drops all of my actors at once rather than one at a time.
Next, add the following to any actor:
'When Mouse button is down
.change attribute game.spawn to game.spawn+1'
Then, add something like 'when attribute game.spawn = 1
.Accelerate' for your first actor and 'when attribute game.spawn = 2
.Accelerate' for your second actor and so on. Then add
'When attribute game.spawn = 16
.Change attribute game.spawn to 1' to any of your actors
Well, that's one way and this is the only way I know of but i'm a noob so yeah.
Next, add the following to any actor:
'When Mouse button is down
.change attribute game.spawn to game.spawn+1'
Then, add something like 'when attribute game.spawn = 1
.Accelerate' for your first actor and 'when attribute game.spawn = 2
.Accelerate' for your second actor and so on. Then add
'When attribute game.spawn = 16
.Change attribute game.spawn to 1' to any of your actors
Well, that's one way and this is the only way I know of but i'm a noob so yeah.