I have a 2D game. I am in a problem. My game has three levels. Actually i have to cars. one is white other is yellow. And there are two types of incoming circles white and yellow. and currently my game is running perfectly. In level one, when yellow car collides with yellow it increases score.same for white car when it collide with white circle score increases. In level 2 everything is same except the factor that cars have to collect opposite color circles. Now in level 3 what i want is that when it starts the cars have to collect same color circles like in level one and after 15 sec cars have to collect opposite color circles like in level 2. and after 15 sec again cars have to collect same color circles like level one⦠And this all keeps repeating. really need help its urgent guys. Thank you in advance.
This code is for level 1
void OnTriggerEnter2D(Collider2D other){
if (other.CompareTag ("white") && car == "white") {
Destroy (other.gameObject);
SoundManager.instance.PlaySingle (circle);
count = count + 1;
SetCountText ();
}
if (other.CompareTag ("Yellow") && car == "white") {
Application.LoadLevel (2);
}
if (other.CompareTag ("Yellow") && car == "yellow") {
Destroy (other.gameObject);
SoundManager.instance.PlaySingle (circle);
count = count + 1;
SetCountText ();
}
if (other.CompareTag ("white") && car == "yellow") {
Application.LoadLevel (2);
}
}
This is for Level 2
void OnTriggerEnter2D(Collider2D other){
if (other.CompareTag ("Yellow") && car == "white") {
Destroy (other.gameObject);
SoundManager.instance.PlaySingle (circle);
count = count + 1;
SetCountText ();
}
if (other.CompareTag ("white") && car == "white") {
Application.LoadLevel (2);
}
if (other.CompareTag ("white") && car == "yellow") {
Destroy (other.gameObject);
SoundManager.instance.PlaySingle (circle);
count = count + 1;
SetCountText ();
}
if (other.CompareTag ("Yellow") && car == "yellow") {
Application.LoadLevel (2);
}
}