was wondering if anyone had tips on implementing large scrolling worlds that have physics on the objects (or not)
some examples:
Bubblehead
http://www.youtube.com/watch?v=A_Tb3vsGZKc#t=0m50s
Pollywog
http://www.youtube.com/watch%3Fv%3DepjxJCT-CgE
Corona seems to perform quite well if you just lay out a lot of objects across a large vertical space and loop through and check if they should be visible if their coordinates are within the viewport… 1000 object sticks around 29-30fps… on the simulator at least,
try my example code from:
http://www.sendspace.com/file/s0cowb
but I’m not doing anything to help performance here eg re-using (pooling) sprites (I’m calling them sprites but they’re just display images rather than spritesheet items)
What I’m wondering though is if you look at something where physics can act on an object, you don’t necessarily want to remove it when it’s off the bottom of the screen, if you’re allowing the user to scroll back down again rather than always going forwards…You’ll need the physical state (position, interaction with other objects etc) to be the same as it was when it went of the screen… maybe these properties need to be stored somewhere before removing it from the off-screen display? Or should i retain the object entirely and just set it’s isVisible=false, rather than re-pool it? If it’s not visible, are physics calculations still performed on it? Or does it just become another data pointer until i enable it’s visibility again? (ie why pool the object, if i’m going to need to store data on its position etc somewhere anyway?)
What I can’t work out is how much of the display optimization Corona does already for offscreen items.
any advice would be appreciated
regards
j
PS as for laying out the levels, i was thinking of using Flash to lay out the whole level and then outputting the coordinates of items with jsfl.
[import]uid: 6645 topic_id: 3854 reply_id: 303854[/import]

