add scripts from post-scale attempt

This commit is contained in:
Sylvia 2026-07-10 01:08:12 -07:00
parent 96dcfa9064
commit 87383d5b8c
18 changed files with 362 additions and 148 deletions

View file

@ -8,7 +8,6 @@ public class Enemy : Entity
{
private Ability abilitySelected;
public SpriteRenderer sprite;
private float currentState = 1;
public float colorChangeSpeed;
[Header("Movement")]
public float moveSpeed;
@ -66,9 +65,8 @@ public class Enemy : Entity
abilitySelected = freeAbilities[Random.Range(0, freeAbilities.Count)];
}
bool success = abilitySelected.TryAbility();
if (!success && abilitySelected.currentCooldown <= 0.5f && currentState >= 1f)
if (!success && abilitySelected.currentCooldown <= 0.5f)
{
currentState = 0f;
StartCoroutine(ImminentAttackAnim());
}
else
@ -108,6 +106,7 @@ public class Enemy : Entity
private IEnumerator ImminentAttackAnim()
{
float currentState = 0;
while (currentState < 1)
{
currentState += Time.deltaTime * colorChangeSpeed;