Added scoring

This commit is contained in:
Gregory Campbell
2020-07-11 16:19:57 -04:00
parent 6faf425d06
commit 7e0e1002a6
3 changed files with 258 additions and 2 deletions
+7 -1
View File
@@ -29,7 +29,13 @@ public class EnemyScript : MonoBehaviour
void OnCollisionEnter2D(Collision2D other)
{
if(other.gameObject.tag == "Bullet" || other.gameObject.tag == "Player")
if(other.gameObject.tag == "Bullet")
{
PlayerPrefs.SetInt("Score", PlayerPrefs.GetInt("Score")+1);
Destroy(gameObject);
}
if(other.gameObject.tag == "Player")
{
Destroy(gameObject);
}