Skip to content
Snippets Groups Projects
Commit 4e22617d authored by Ryan Hoppe (rmh898)'s avatar Ryan Hoppe (rmh898)
Browse files

Changing enemy hits so they take damage based on the range of the equipped...

Changing enemy hits so they take damage based on the range of the equipped weapon.... correct me if I'm wrong.
parent e5bf1317
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ using System.Collections;
public class EnemyHealth : MonoBehaviour {
public static float health;
public WeaponStats currentWeapon;
void Start() {
......@@ -24,8 +25,8 @@ public class EnemyHealth : MonoBehaviour {
void OnTriggerEnter2D(Collider2D other) {
if (other.gameObject.tag == "Enemy") {
Debug.Log("hit");
health = health - 1;
health = health - Random.Range(currentWeapon.damageMin,currentWeapon.damageMax);
}
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment