I'm making a 2D game with no levels like flappy bird. How many scenes will I need?
Hi! I'm a beginner in Unity. I'm creating a simple unity 2D game like flappy bird where there are no levels but it depends on the reaming lives of the user. How many scenes do I need to make? And once done, to finish my game, do I have to combine them or something before exporting the game as a whole? Any help would be appreciated. :-)
Answer by xxmariofer · Feb 15, 2019 at 08:28 AM
hello, you can use as many as you want, maybe for separating the menus etc. but you only need 1. but if you wanted to have multiple scenes you just need to go to File>Build Settings and add all the scenes to that build that you need. for Changing bewteen scenes in cod eyou can use the Scene Manager class
Hi! Thanks. Can you tell me what you meant by "one scene only"? I can only place a few tiles in one scene
i dont really understand what you mean place a few tiles in one scene. we are both talking about the scene assets right? you can place as many tiles as you want.
I think he means content. If you're just starting with Unity, and your game will be simple like Flappy bird, and it will be a single level game, take this into account
level structure is very important. I personally use 1 scene unless i can avoid it, but that means that i create a structure on top of that scene that handles screens, screen transitions, load/unload of screen content. You might just want to use 2 scenes here, for ease of use, just because you are starting with Unity. Using multiple scenes can cause a bit of hiccup (even with Asynchronous scene load/unload), because you don't have 100% control over some of that process of load/unload (eg pooling).
Object Pools - if you have time, check them and learn to use them.
Back to InGame level structure - you can literally draw your whole level into 1 scene, there are little limits here (i just tried adding an object at position.x=10000 into scene and it worked fine). $$anonymous$$ake sure your assets are the proper size - default size of 1 unit in Unity is 100px per 1 unit - use this when sizing your assets. Check Static Batching and use it to give you performance boost, but i still prefer Object Pools. I can see 2 ways you could go about building your levels: A) draw whole level into 1 scene, apply static batching to non moving objects (better make Prefabs for this so its shared and you dont have to click all objects individually), and then just hit play and there you have it. Unity's built-in Frustrum Culler should make your job easy by culling out-of-view Renderer's, so your performance doesnt suffer as much. B) create your template engine, where you build your level. When you start the game, you rebuild the game view based on your custom Culler, which is more optimized for your use-case , you spawn the inco$$anonymous$$g objects from/despawn them back into an ObjectPool, based on whatever needs to come in or leave out. This is more optimized, you have more control, but unless you are more experienced, there is much more chance to mess things up, as you dont rely on things like Static Batching or Unity's Culling or Scenes to make your life automatized and easier.
So for a beginner, i would suggest you research them topics a bit (Static Batching, Object Pooling, Scenes)
Then draw your whole level into 1 scene, slap some static batching on the immovable objects, make camera follow your bird, move bird horizontally, and when ure done with the game, create another scene, make a menu there (play/options/exit/whatever), and connect it with the other scene. Use one scene at a given time, no composites. Its just simpler.
One more thing. If i could come back in time and help myself as i was starting to learn Unity, i would tell myself to watch all the videos from this page https://unity3d.com/learn/tutorials Unity makes amazing beginner/intermediate/advanced-friendly tutorials (and they are sorted accordingly)
very detailed explanation, upvoted for accuracy ;)
Your answer
Follow this Question
Related Questions
how do I make 2 player sprites not interact? 0 Answers
How to create dialog box that's properly scaled and appears at bottom of screen? 0 Answers
why do i keep getting compiler errors even though my script has no errors? 2 Answers
I'm currently working on a top-down shooter and I want to make shotgun 3 Answers
Having multiple spawn/starting points in one scene 0 Answers