Roll a Ball Based Game Project.

Hello Everyone!

I’m working about a month on a project, wich i started out from the Roll a Ball Tutorial, here from unity! :smile:

but now i’m facing a problem…

i want the player to need different Scores on every level, for example…

Level 1 = 10 Points to Pass.
Level 2 = 20 Points to Pass.
and so on…

but i can only define the Value as a fixed number… for example, if i put “100” the player will need 100 points even in Stage 1.
if someone can help, please do ! :slight_smile:
here is the code, almost all provided from the Roll a Ball video Tutorial.

void SetCountText ()
    {
        countText.text = "Count: " + count.ToString ();
        if (count >= 100)
        {
            int i = Application.loadedLevel;
            Application.LoadLevel(i + 1);
            winText.text = "You Win!";
        }
    }

Ah, the rollerball. Great tutorial.

I am using still using assets from the spaceshooter tutorial as placeholder art in my project :slight_smile:

Something like

void SetCountText ()
int i = Application.loadedLevel;  //initiating the variable here so the "if" can use it.
     {
        countText.text = "Count: " + count.ToString ();
        if (count >= i*10)
        {
            Application.LoadLevel(i + 1);
            winText.text = "You Win!";
        }
    }

This isn’t perfect, the “You Win!” text will not display, as you destroy all objects as you load the new scene. (unless this object, and the text object is set to “don’t destroy on load”

Why havent you tried using enable and disable on UNITY 4.6 CANVAS or what it now Set.Active() etc… so much easier and seems to follow across scenes nicely too…