How to make game progression similar to Hades?

Hello!

First of all, i’m a beginner at C# but not a programming as a whole, but this may be a little ambicious.
There’s no game yet, i’m just thinking about it, I want to make a 2D game with level progression, but change the starting area a bit every time the player beats one of the levels, as well as unlocking the next level, but I have little to no idea of how to script this, does anyone have any ideas or help in general? Thanks in advance!

Have a list of GameObjects for each level, once the level is completed, activate that list of GameObjects. Could even have another list to store GameObjects you want to deactivate if necessary.

1 Like

You would simply create multiple scenes, and then use code somewhat like this to switch between scenes.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneChanger: MonoBehaviour {
    OnCollisionEnter(Collision, col) {
       if (col.GameObject.tag == "Player") {
        SceneManager.LoadScene("Level2");
          }
    }

Then, you would make some sort of way to beat the level. For example if a player collects all coins or gets to a certain point. If you chose the simpler, latter method, you would attach the script above to the 2d object that you want to end the level with. You could do this discretely, with some sort of transparent, small, or camouflaged gameObject, or you could do it more noticeably, with something like a flag pole (mario). Just remember to have a player tagged with player, and name this script SceneChanger. Btw sorry if this has bad syntax or something, but I am relativly new to c# and had this problem a long time ago.

1 Like

First of all, thanks for the anwers of you guys, just a little question, I was already thinking of doing what you said and your code really helps, but, if I wanted to instead, after the win, transfer the player to a victory screen then to the starting area I would simply do this multiple times right? Seems really straight forward.
Also, problably the “hardest” part of this would be a game save file, I have somewhat of an idea of how save files work, but at the same time I don’t know how/what should I check for the next time the player hits the play button he should be teleported to the last level place he was instead of the first one, maybe it isn’t too hard but I could definitely be stuck at that for a while lol, any help about this would be amazing as well.

Oh, all you would have to do is insert public int section = 1;, and change the value. For a full reference,

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneChanger: MonoBehaviour {
   public int section = 1;
    OnCollisionEnter(Collision, col) {
       if (col.GameObject.tag == "Player") {
        SceneManager.LoadScene("Level2");
        section = 2;
          }
    }

. Then, in your save script, just check the “Section” the player is on, and that will be the level they were on last.
Also, your reasoning for the victory screen was correct.

1 Like

Wow, that is actually really simple haha, thanks!

1 Like

You’re welcome :slight_smile: EDIT: Oh… If you use : ) it corrects that to :)…

1 Like

Hahaha there’s also the “Smilies” tab with some cool smilies lol :wink: :smile: :stuck_out_tongue: :sunglasses:

1 Like

Um… I just noticed that the :smile: is supposed to stand for big grin… I thought that stood for someone pretending to be happy but in reality being nauseated by how disgusting something was lol.

1 Like

The color selection for them probably wasn’t the best for some xD :face_with_spiral_eyes:

But most of them are pretty good, way better than steam ones at least :roll_eyes: (there’s no way this is a rolling eyes emoji)

yeah ikr

1 Like