diff --git a/Assets/Scripts/GMScript.cs b/Assets/Scripts/GMScript.cs index 631e034..7a79e52 100644 --- a/Assets/Scripts/GMScript.cs +++ b/Assets/Scripts/GMScript.cs @@ -34,8 +34,9 @@ public class GMScript : MonoBehaviour if(obstacleTime > obstacleSpawnTime) { - Instantiate(obstacle, new Vector2(Random.Range(-8.0f, 8.0f), Random.Range(-4.0f, 4.0f)), + GameObject newObstacle = Instantiate(obstacle, new Vector2(Random.Range(-8.0f, 8.0f), Random.Range(-4.0f, 4.0f)), Quaternion.Euler(0,0,Random.Range(0.0f, 360.0f))); + newObstacle.transform.localScale = new Vector2(Random.Range(1.0f, 8.0f), 1.0f); obstacleSpawnTime = Random.Range(5.0f, 15.0f); obstacleTime = 0.0f; } @@ -43,8 +44,10 @@ public class GMScript : MonoBehaviour if(enemyTime > enemySpawnTime) { - Instantiate(enemy, new Vector2(Random.Range(-8.0f, 8.0f), Random.Range(-4.0f, 4.0f)), + GameObject newEnemy = Instantiate(enemy, new Vector2(Random.Range(-8.0f, 8.0f), Random.Range(-4.0f, 4.0f)), Quaternion.identity); + float scaleChange = Random.Range(0.5f, 1.5f); + newEnemy.transform.localScale = new Vector2(scaleChange, scaleChange); enemySpawnTime = Random.Range(5.0f, 15.0f); enemyTime = 0.0f; } @@ -61,8 +64,8 @@ public class GMScript : MonoBehaviour spawn = new Vector2(Random.Range(-8.0f, 8.0f), Random.Range(-4.0f, 4.0f)); - if((spawn.x > playerPos.position.x + 2 || spawn.x < playerPos.position.x - 2) - && (spawn.y > playerPos.position.y + 2 || spawn.y < playerPos.position.y - 2)) + if((spawn.x > playerPos.position.x + 4 || spawn.x < playerPos.position.x - 4) + && (spawn.y > playerPos.position.y + 4 || spawn.y < playerPos.position.y - 4)) { valid = true; }