Move Gun.cs to Assets/Scripts C#/

This commit is contained in:
2024-10-27 20:01:23 -07:00
parent 719ecf18aa
commit 773a30a6b9
3 changed files with 2 additions and 1 deletions

View File

@@ -1,21 +0,0 @@
using UnityEngine;
public class Gun : MonoBehaviour
{
public float damageStrength;
void OnTriggerEnter2D (Collider2D hit) {
// Damage player and destroy self on impact
if (hit.tag != "Player") return;
hit.GetComponent<Teo>().health -= damageStrength;
Destroy(gameObject);
}
void Update() {
transform.Rotate(new Vector3 (0, 0, Time.deltaTime * 1000));
if (Vector3.Distance(
transform.position,
GameObject.FindGameObjectWithTag("Player").transform.position
) > 20) Destroy(gameObject);
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 9960e65b78321cc8a85166a904f8f617