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,11 +1,15 @@
using System;
using Core.Extensions;
using UnityEngine;
public class Player : Entity
{
[Header("Ground Detection")]
[SerializeField] private Transform groundCheck;
[SerializeField] private LayerMask groundLayer;
[SerializeField] private Camera cam;
private void Update()
{
attackOriginCenter.Lookat2D(cam.ScreenToWorldPoint(Input.mousePosition));
}
private void FixedUpdate()
{
Vector2 movement = new Vector2(Input.GetAxis("Horizontal") * speed, rb.linearVelocityY);
@ -15,9 +19,4 @@ public class Player : Entity
}
rb.linearVelocity = movement;
}
private bool OnGround()
{
return Physics2D.OverlapCircle(groundCheck.position, 0.05f, groundLayer);
}
}