Tables or not?
Hey guys,
does it make sense using tables when reusing actors?
So basically I have a big scene concerning width and the main
actor has to run all the way to finish. In fact of that I have many actors
that can't be seen at the beginning because they are simply out of scene.
To improve performance I thought of resizing old actors that went out of
scene and just put them to the top again. This way I could save a lot of
actors. Hope it makes sense.![:D :D](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/grin.png)
I always work with the self position X of the main actor. So does it make sense to use tables
for all the positions etc. or is there a more simple way?
All is about keeping the FPS as high as possible.
Thx Alex
does it make sense using tables when reusing actors?
So basically I have a big scene concerning width and the main
actor has to run all the way to finish. In fact of that I have many actors
that can't be seen at the beginning because they are simply out of scene.
To improve performance I thought of resizing old actors that went out of
scene and just put them to the top again. This way I could save a lot of
actors. Hope it makes sense.
![:D :D](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/grin.png)
I always work with the self position X of the main actor. So does it make sense to use tables
for all the positions etc. or is there a more simple way?
All is about keeping the FPS as high as possible.
Thx Alex
Comments
If attribute game.MainCharacterPositionX > self.Position.X + (game.Screen.Size.Width/2)+(self.Size.Width/2), then change attribute self.position.X to self.position.X + random(game.Screen.Size.Width*2,game.Screen.Size.Width*10)
Also, if you want to improve FPS, check out one of my posts from earlier this week.
http://forums.gamesalad.com/discussion/46652/31-optimization-tips
Thx for the rule but the thing is that we design the complete level
and don't work with random...so each actor is placed before in the
complete scene...mhmm
Ok, let's say you have an actor prototype with 10 instances. Each instance needs to be unique so it can link to a specific data set in a table. Simply throw all your actor instances in a layer on your scene (organizational purposes only) and rename each one to an integer value. So the first instance name would be 1, second would be 2, and so on.
Now you can start linking to a table. Example: change self.PositionX to tablecellvalue([table name], self.name, 1). So instance 5 for example, will now get position x from row 5, column 1. I started using the name of the instance because I got tired of creating unique ID attributes inside each instance.
You can get really deep with tables. Try playing with tablecellvalues within tablecellvalues to get really creative.
Meaning is it possible to have my general table ( "levels" ) contain the names for the tables of separated levels ( "level_01", "level_02" etc. ) and later call the appropriate table for every level?
When I use tableCellValue(table, row, column) is it possible to set "table" variable using some text variable containing table name?
Thanks!