Commit b8101e4e authored by Bene's avatar Bene

Updated the restart script, every plattform gets destroyed now and new...

Updated the restart script, every plattform gets destroyed now and new plattformtypes are spawned after a restart with a reasonable distance
parent 32efd4af
......@@ -11,6 +11,8 @@ public class Restart : MonoBehaviour
public GameObject Character;
public Sprite newSprite;
public GameObject spawner;
public void RestartGame()
{
Player.transform.position = new Vector3(0f, 10f, 0f);
......@@ -23,9 +25,11 @@ public class Restart : MonoBehaviour
Movingplattforms[] plattformen = FindObjectsOfType<Movingplattforms>();
for (int i = 0; i < plattformen.Length; i++)
{
int plattformoffset = Random.Range(-20, 0);
int plattformtiefe = Random.Range(3, 3);
plattformen[i].gameObject.transform.position = new Vector3(plattformtiefe,plattformoffset,0.0f);
Destroy(plattformen[i].gameObject);
//int plattformoffset = Random.Range(-20, 0);
//int plattformtiefe = Random.Range(3, 3);
//plattformen[i].gameObject.transform.position = new Vector3(plattformtiefe,plattformoffset,0.0f);
}
spawner.GetComponent<SpawnerScript>().generateplattform();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment