playMaker

Author Topic: Crating multiple levels from single scene  (Read 641 times)

heavygunner

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Crating multiple levels from single scene
« on: October 17, 2018, 10:52:47 AM »
Hi !

I have a scene where it will spawn 5-10 cubes randomly. Once player collected cubes, level will be completed.

What I want is, When scene run first, it should be Level 1, Once is passed, same scene should be loaded as Level 2, this should be continued. So, I can make infinite levels.

How to do it?

waveform

  • Playmaker Newbie
  • *
  • Posts: 28
    • View Profile
Re: Crating multiple levels from single scene
« Reply #1 on: October 17, 2018, 11:59:08 AM »
well, in this case probably best way is make a prefab for each level

heavygunner

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: Crating multiple levels from single scene
« Reply #2 on: October 17, 2018, 12:26:51 PM »
well, in this case probably best way is make a prefab for each level
I said above game concept is just for example. If i want 1000 levels, I have to make 1000 prefabs ?

A long ago, I has an Unity source code. It has an option inspector "Number of Levels to Create". If you put 1000 and hit enter, It will make 1000 levels while playing. But, There will be only single scene in project

Thore

  • Sr. Member
  • ****
  • Posts: 349
    • View Profile
Re: Crating multiple levels from single scene
« Reply #3 on: October 17, 2018, 01:25:47 PM »
You take your level integer, use that to populate the scene, and probably show some UI text that this is level X. After the player completed it, you add +1 to level, perhaps do some cleanup (pool/destroy objects, reset things), rinse and repeat.

If objects have some starting position, initialisation, and can be moved around etc. you can make a RESET (example name) global event, which you might add to the START state. At the end of one level, broadcast RESET and everything is set to the start state.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4648
    • View Profile
    • jinxtergames
Re: Crating multiple levels from single scene
« Reply #4 on: October 17, 2018, 02:35:33 PM »
Hi,
Depending on how many things needs to be changed, i would go for Xml (Datamaker)

One reason for me :

It would be easier to input the data.
And it would even be possible to make an "editor automation'' to add all the object locations to a txt file with a single press of a button (maybe even directly to add to an xml)