- Home /
How do i make a spawing level?
Hello how do i make a level spawn like doodle jump has where there floor blocks are spawned for the player to step on. How would i go about doing this using a game object? and have it spawn more objects as they get Farther in the level?scripts would be great.
Answer by Setzer22 · Jun 10, 2012 at 02:42 PM
Well, I cannot post a whole script for you, that would be making the most part of your game, but I can help into breaking down some of the game logic, hope that helps.
I don't know how do the levels work in doodle jump. I assume they are created randomly, so first of all you should design your own algorythm for the level generation. You should think that random platforms should be generated on screen where the player is, so all your calculations should be done relatively to the player's position.
You should also take into account the X and Y of the instantiated platforms as well. You need to determine first the Y position of the platform, that could be possibly done by adding a number (which can vary randomly) to the last platform's Y, and also a random X value to get the platform in the desired point of the screen (I'm assuming you want to make it look 2D, else you should also think of the Z coordinate).
You might have to do some cleaning after the screen has moved up, deleting the platforms which you cannot see, so the game can run all the time you want (which seems to be the point of doodle jump), also, you might want to program it so it doesn't create two platforms at the same height unless you want it.
It doesn't look easy, some pseudocoding and even writing down a diagram of what you want could help you having your game done, I don't think anybody would post you a full script of what you want. You will have to hire a programmer for that.
Anyway, hope that helped ^^
Your answer
![](https://koobas.hobune.stream/wayback/20220613072605im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
A node in a childnode? 1 Answer
How do i get this to spawn over time? 1 Answer
Generate obstacles within boundry 1 Answer
I am having spawning problems. 2 Answers
Spawn Script not working on iPhone? 0 Answers