movement, automated enemies, automated players, basic abilities

This commit is contained in:
Sylvia 2026-06-09 05:27:47 -07:00
parent 23576e137e
commit f4344c4700
31 changed files with 4343 additions and 70 deletions

View file

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using UnityEngine;
public class Entity : MonoBehaviour
@ -9,8 +10,17 @@ public class Entity : MonoBehaviour
[Header("Stats")]
public float speed;
public float jumpPower;
[Header("Abilities")]
public List<Ability> abilities = new();
public Transform attackOriginPoint;
[SerializeField] protected Transform attackOriginCenter;
[Header("Cache")]
[SerializeField] protected Rigidbody2D rb;
public List<Entity> entitiesInRange = new();
public Entity closestEntity;
[Header("Ground Detection")]
[SerializeField] private Transform groundCheck;
[SerializeField] private LayerMask groundLayer;
public void TakeDamage(float damage)
{
@ -31,4 +41,8 @@ public class Entity : MonoBehaviour
{
}
protected bool OnGround()
{
return Physics2D.OverlapCircle(groundCheck.position, 0.05f, groundLayer);
}
}