Best wat to destroy bullets that are off screen?
Shanesta
Member Posts: 63
What is the best way to destroy bullets that are off screen in a scrolable game, the play ares is a good bit bigger that the screen in all directions.
I can think of a few ways to do it, but im not sure what is the most effecient.
It would be nice to have this as an option in the rule section -actor receives event / is offscreen.
I can think of a few ways to do it, but im not sure what is the most effecient.
It would be nice to have this as an option in the rule section -actor receives event / is offscreen.
Comments
When self.Time > 3
- Destroy this actor
A rule would state something like:
If self position X >480
If self position X< 0
If self position Y >320
If self position Y< 0
Then drag in the behaviour 'destroy actor' into the rule.
Make sure the 'any' option in the rule is on, rather than 'all'.
If the play area is bigger than the screen, then yes, the timer works well, as outlined by Cobra. It really depends how fast the bullet is moving and how fast the player is moving too. You don't want to be able to follow the bullet and watch it disappear!
You're right though, it is a tad laborious and can crowd up a rule.
Hope that helps,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io