Should I destroy actors out of camera view (platformer) ?

machinegunkellymachinegunkelly Member Posts: 56
edited July 2012 in Working with GS (Mac)
I know ( or think ) that gamesalad has a trash removal system that will remove actors that fall out of the scene, but I'm wondering specifically about longer platformer levels...

My current levels are 30000 px wide and action only moves to the right, do I need to destroy objects as they fall off the screen ( but still in the scene area ) to the left?

thanks in advance friends!!! :D

Best Answer

  • tatiangtatiang Posts: 11,949
    Accepted Answer
    You do need to manage the actors. If you don't reuse them within the scene, destroying them is a good idea to improve efficiency (speed/memory, etc.). This can be accomplished with a simple rule: When self.position.Y < 0-self.height/2 --> Destroy Actor.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Answers

  • ericzingelerericzingeler Member Posts: 334
    Are you spawning actors at all?
  • machinegunkellymachinegunkelly Member Posts: 56
    You do need to manage the actors. If you don't reuse them within the scene, destroying them is a good idea to improve efficiency (speed/memory, etc.). This can be accomplished with a simple rule: When self.position.Y < 0-self.height/2 --> Destroy Actor.
    Will look into it thanks :D
    Are you spawning actors at all?
    Not too many, any I do are just like a "500" points flying out of a coin or similar



  • ORBZORBZ Member Posts: 1,304
    any actors in the scene will consume CPU. If you are no longer using them, destroy them.

    Note: If an actor falls too far off the scene (not camera) it will self-destruct. For example, an actor at x: -1000, y: -1000 will auto-destruct.
Sign In or Register to comment.