Prevent bullets from going off screen
ookami007
Member Posts: 581
Is there a way to test whether or not an actor is off screen with a scrolling camera?
I don't want the players bullets to go off screen and kill things he hasn't seen.
Comments
Put an invisible stationary actor around the border areas of your game. If bullet hits it, destroy bullet.
Or do some maths with an offset for the cameras position.
If the bullets x or y is greater or less than the screen width/height plus the cameras origin (accessible from an unlocked actor). Destroy bullet or move it off the side of screen till its required in another shot (recyling actors rather than spawning)
I use the bullet destroy border as well.
Complete Guide to iOS Publishing {} Complete Guide to Mac Publishing
I tried putting a bullet destroying wall on the HUD (non scrollable) but it seems like the EFFECT "scrolls" rather than staying on the ends of the screen with the rest of the HUD... even though visibily it's there on the ends of the screen... WEIRD...
Any ideas?