From 36844903ad17adb90eb96a4704c35288f9bce6ce Mon Sep 17 00:00:00 2001 From: Victor Turgeon Date: Wed, 11 Oct 2023 11:09:24 -0400 Subject: [PATCH] Update Enemy.gd --- Scripts/Enemy.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/Enemy.gd b/Scripts/Enemy.gd index 452f66a..9b2a229 100644 --- a/Scripts/Enemy.gd +++ b/Scripts/Enemy.gd @@ -8,7 +8,7 @@ extends CharacterBody2D @onready var is_dying: bool = false @export var level: int = 1 -@export var hp: int = 50 +@export var hp: int = 100 @export var maxhp: int = 100 @export var maxvel: float = 2 @export var experience: int = 0 @@ -178,7 +178,7 @@ func receive_damage(dmg): func receive_exp(x): experience += x - if experience > levelup[level - 1] && level <= 8: + while experience > levelup[level - 1] && level <= 8: setLevel(level + 1) exp_gained.emit(experience, 0 if level == 1 else levelup[level - 2] ,levelup[level - 1], level)