- Home /
Architecture of "doodle jump" type gameplay
Hi Guys, I am starting a doodle jump type of game which will be infinite. I have a requirement to have infinite (moving) background on these ends. I have some questions and need your suggestions to choose the best way in terms of memory and gameplay. Game would be for ios and android. So, my initial thoughts are
I am planning make a character jumping on platforms. A scrolling or doodle jump like background ( which ll seem to move when character moves upward) so, my thoughts are for this kind of background is
to take a large image i.e of 2048x2048, make 2 planes, set this texture to them, when one plane ends other ll move its position on top of first, when second ends first ll move on top of second and so on
Other approch could be a "Instantiate" and "Destroy" of small planes having textures on them.
I would like ask about the platforms that ll be require character to jump on.
One approach is to "Instantiate" platforms when reach on top or on left and right and then "Destroy" when out of some point threshold
The other approach could be a pack of 2-3 platform bundles ( make them on scene just once), and use them the same way as background described above which is changing their positions according to character position.
There are about 25 different levels each background in each level. Do you guys recommend to make 25 difference scenes and load them one by one. Is that recommended to have more scenes ?
They are my thoughts, I want to go for best approach and would like to listen the best one. Is there any more appropriae way to achieve moveable background and about platforms, I ll appreciate your suggestions Thanks.
Answer by alpaca of zion · Jan 06, 2013 at 04:17 PM
If your background is seamless you could fix the position of the background image with the camera. The as the camera moves, change the texture offset on the background material. http://docs.unity3d.com/Documentation/ScriptReference/Material-mainTextureOffset.html.
I think the easiest way to handle the platforms would be to create and destroy them as the character moves. Rearranging them would probably be more efficient, but I think the performance increase would probably be nominal.
hey thanks man, textureoffset works brilliant, what do you think making multiple scene, like if angry birds has 25 levels, is that recommended to create 25 scenes ?
Depends on what the differences are from level to level. If you are just changing platform sets and the number of kinds of platforms in an area I would do it with one scene.
I would make a logic script that covers layouts, points, etc. In the logic script you could make a list of Level scripts. Each Level script would have the unique variables for each level, number of different kinds of platforms, what platform set to use, etc.
When a level is finished the scene can be reloaded. At this point I would persist an object that tells the logic script what "level to load in the start function.
Your answer
Follow this Question
Related Questions
How to handle huge images in unity? 0 Answers
Unity iOS memory usage 0 Answers
Bug? CUBE map using a LOT of memory 1 Answer