Near finish

This commit is contained in:
2023-07-30 23:14:41 +05:30
parent 1569760e7b
commit 400336ef4f
1979 changed files with 1696464 additions and 301 deletions

View File

@@ -5,7 +5,23 @@ using UnityEngine;
public class Obstacle : MonoBehaviour
{
void OnTriggerEnter2D(Collider2D other){
if(other.tag == "Powerup"){
LevelGeneratorV2.instance.DespawnPickup(other.gameObject);
PlayerController.instance.ActivatePowerup();
return;
}
Debug.Log(other.name);
if(other.tag == "asteroid"){
if(PlayerController.instance.PowerupActive){
PlayerController.instance.SpawnExplosionFX(other.transform.position);
LevelGeneratorV2.instance.DespawnAsteroid(other.gameObject);
DataManager.AddItem("add_asteroid.php");
return;
}
}
PlayerController.instance.GameOver();
}
}