Hello,
Im making Brick Breaker style game, and i can’t figure out how to change level when you destroy all bricks in one level, can someone help me?
BTW: Im Using JavaScript language.
You can load the next level with:
Application.LoadLevel();
I know this, but how can i make to load next level, when i destroy all bricks, because now when all brick are destroyed i just can hit the ball and i want to load next level…
function Update ()
{
var bricks : GameObject[ ] =GameObject.FindGameObjectsWithTag(“Brick”);
if (bricks.Length < 1)
{
Application.LoadLevel(2);
}
}
By just calling Application.LoadLevel (Application.loadedLevel+1)
Thank You it works now And i have another question, how to make that you can unlock new levels?