Create Gun thrower subclass of ratbot that spawns gun objects

This commit is contained in:
2024-10-27 17:59:13 -07:00
parent 77f507183d
commit 89953e7cd6
18 changed files with 587 additions and 10 deletions

11
Assets/Enemy/Gun.cs Normal file
View File

@@ -0,0 +1,11 @@
using UnityEngine;
public class Gun : MonoBehaviour
{
public float damageStrength;
void OnTriggerEnter2D (Collider2D hit) {
if (hit.tag == "Player") {
hit.GetComponent<Teo>().health -= damageStrength;
}
}
}