random stuff i forgot to commit
This commit is contained in:
parent
274af1e5a1
commit
b0625ae834
59 changed files with 7806 additions and 664 deletions
30
Assets/Scripts/Entities/Player.cs
Normal file
30
Assets/Scripts/Entities/Player.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class Player : Entity
|
||||
{
|
||||
[Header("UI")]
|
||||
[SerializeField] private TextMeshProUGUI livesText;
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
abilities[0].TryAbility();
|
||||
}
|
||||
if (Input.GetMouseButtonDown(1)) //this way kinda sucks but i'll fix it when i feel like it
|
||||
{
|
||||
abilities[1].TryAbility();
|
||||
}
|
||||
}
|
||||
|
||||
public override void TakeDamage(int damage)
|
||||
{
|
||||
base.TakeDamage(damage);
|
||||
UpdateLivesUI();
|
||||
}
|
||||
private void UpdateLivesUI()
|
||||
{
|
||||
livesText.text = $"Lives: {health}/{maxHealth}";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue