refactor: cleaning movement code

moved skills and potions to skill handler
This commit is contained in:
2025-08-31 00:25:23 +02:00
parent 8eac9d6bde
commit 63fede11cb
2 changed files with 38 additions and 24 deletions

View File

@@ -31,27 +31,7 @@ public class PlayerMovement : MonoBehaviour
private void Update()
{
if (Input.GetKeyDown(KeyCode.Space) && !playerSkillHandler.IsOnCooldown(PlayerSkillTree.Skills.Dash))
{
/* Get the input for horizontal and vertical movement */
float moveX = Input.GetAxisRaw("Horizontal");
float moveZ = Input.GetAxisRaw("Vertical");
move = new Vector3(moveX, 0, moveZ).normalized;
StartCoroutine(playerSkillHandler.DashCoroutine(controller, move));
}
if (Input.GetKeyDown(KeyCode.L))
{
if(PlayerSkills.TryUsePotion(PotionHandler.PotionType.HealthBig))
{
Debug.Log("Potion used!");
}
else
{
Debug.Log("Potion not available!");
}
}
}
void FixedUpdate()