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

View File

@ -2179,7 +2179,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 18.840088, y: 23.799988} m_AnchoredPosition: {x: 18.840088, y: 23.800049}
m_SizeDelta: {x: 452.8, y: 206.7} m_SizeDelta: {x: 452.8, y: 206.7}
m_Pivot: {x: 0, y: 1} m_Pivot: {x: 0, y: 1}
--- !u!114 &1209384639 --- !u!114 &1209384639
@ -2760,7 +2760,7 @@ MonoBehaviour:
eulerAngles: {x: 0, y: 0, z: 0} eulerAngles: {x: 0, y: 0, z: 0}
movingSpeed: 0.1 movingSpeed: 0.1
boostSpeed: 0.35 boostSpeed: 0.35
turnAngle: 15 turnAngle: 31
trailPrefab: {fileID: 1182127216} trailPrefab: {fileID: 1182127216}
currentTrail: {fileID: 0} currentTrail: {fileID: 0}
senseRadius: 0.58 senseRadius: 0.58

View File

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

View File

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