This commit is contained in:
2023-01-23 19:12:09 +05:30
parent 8e6a706c1c
commit 787a59b37b
3 changed files with 13 additions and 8 deletions

View File

@@ -21,15 +21,18 @@ public class OptionsSpawner : MonoBehaviour
void Update()
{
if (!PlayerController.Started) { return; }
if(PlayerController.t.position.y < 100){
if(PlayerController.t.position.y < 20){
goodSpawnRate = 2;
badSpawnRate = 1;
}else if(PlayerController.t.position.y < 500){
}else if(PlayerController.t.position.y < 90){
goodSpawnRate = 2;
badSpawnRate = 2;
}else{
}else if(PlayerController.t.position.y < 120){
goodSpawnRate = 1;
badSpawnRate = 3;
}else{
goodSpawnRate = 1;
badSpawnRate = 5;
}
if (t < SpawnTimer)
{

View File

@@ -27,9 +27,10 @@ public class PlayerController : MonoBehaviour
void Start()
{
CameraFollower.Target = transform;
}
bool gameStarted =false;
public void GameOver(){
Started=false;
spriteRenderer.sprite = downwardSprite;
@@ -92,10 +93,11 @@ public class PlayerController : MonoBehaviour
void SwitchSide(){
if(!Started){
if(!Started && !gameStarted){
gameStarted = true;
GameManager.instance.StartGame();
Started=true;
}
Started=true;
transform.eulerAngles = new Vector3(transform.eulerAngles.x, transform.eulerAngles.y, isUp ? -turnAngle : turnAngle);