Load Levels After Last Sphere Destruction

Hey guys, I am trying to teleport my player to the next chronological level once they destroy the last sphere on the map. How can I make it easier to go to the next sequential level after the last sphere of Level 2 is destroyed without affecting the behavior at Level 1? Should I make an entirely new bundle for that?


HighPower Game

All code is reset upon loading a level, if the same object is on level 1 and level 2, they both will have 8000 health. Additionally, it will have 8000 health when restarting the level too.

You could change the LoadLevel behavior to “Next Level” so it doesn’t just load one level.
If you want the Health value to change every level, there is some additional behavior to add but would be simple to do.

2 Likes

I now have another issue: when I load into the 2nd level, the enemy doesn’t follow and drain my health. Is there a way to fix it? I also want to make it so that once every sphere is destroyed, they go to the next level

For the enemies:
In the proximity behavior, remove the “soldier” option to “any object”.

For next level:
In the small sphere object:

image

In medium sphere:


Now if you plan on having multiple medium spheres, then you will need to move the “LoadLevel” code to the player and the code shown for the small sphere would go in the medium sphere messaging the player.

2 Likes

Your solution kind of works, but it teleports me after destroying the 2nd small sphere. I’m also going to have a Large Sphere and a Giant Sphere. I want to make it possible so that once you destroy all the spheres on the current level, you go to the next level.

1 Like

yo another DB fan on the forums!

1 Like

Why is “Count” set to 2 in small sphere object?

There are 2 small spheres in Level 1

The number has to be 1, that number itself counts how many spheres are in the level by adding all the 1’s together.

How about I send the message to the player since I want him to teleport to the next level after destroying the sphere?

That would be better, as long a single object can count and activate the Next Level trigger.
I showed the meduim sphere because that was what you were using for the LoadLevel behavior at the end of the level. But as I said above, its not good if you plan on using multiple meduim spheres in a single level.

Here’s an example using globals to send to the player.

Spheres:

Player:

1 Like

What if I have more than 3 spheres in a level? Would I have to adjust the global variables?

This setup will let you have as many small and meduim spheres as you want.

1 Like