Destroying Actors vs re-using Actors through Tables
maltadirk
Member, PRO Posts: 26
Hi,
I have just finished creating an infinite side-scrolling game. For the background I created an actor from outside the right-side of the screen, move it to the left, then destroy it when it leaves the screen on the left-side. This obviously involves lots of creating and destroying of actors, especially since I have multiple actors like clouds, trees, hills, ect...
I'm reading through "Learn GameSalad for iOS". It stats that its actually better to use tables and re-use actors rather then continuous creating and destroying. So I'm thinking instead of using the above method, using a method where 2 actors of the same actor are created and constantly being reused by moving their coordinated.
Apparently its less stressful full GameSalad to re-use the same actors, rather then creating and destroying. Will this actually improve the performance of the game?
I have just finished creating an infinite side-scrolling game. For the background I created an actor from outside the right-side of the screen, move it to the left, then destroy it when it leaves the screen on the left-side. This obviously involves lots of creating and destroying of actors, especially since I have multiple actors like clouds, trees, hills, ect...
I'm reading through "Learn GameSalad for iOS". It stats that its actually better to use tables and re-use actors rather then continuous creating and destroying. So I'm thinking instead of using the above method, using a method where 2 actors of the same actor are created and constantly being reused by moving their coordinated.
Apparently its less stressful full GameSalad to re-use the same actors, rather then creating and destroying. Will this actually improve the performance of the game?
Comments
By the way, tables have nothing to do with this unless you're trying to do something more complicated than you mentioned.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
With regards to Tables your right, not much use in this case but to actually keep track of where the spawn X/Y values are for each Actor. Plus Tables would be useful in the case of different generating different spawn points for different level.