Skip to content

Commit 9312a85

Browse files
committed
added updating abilities to actor update method
1 parent efbc0a1 commit 9312a85

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

gameObjects/Actor.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ class Actor extends GameObject
44
animation = null;
55
HP = 10;
66
MaxHP = 10;
7+
abilities = [];
78
constructor(shape, type="actor")
89
{
910
super(type);
@@ -15,6 +16,9 @@ class Actor extends GameObject
1516
}
1617
update(dT)
1718
{
19+
this.abilities.forEach((a)=>{
20+
a.update(dT);
21+
});
1822
if(this.animation)
1923
this.animation.animations['idle'].update(dT);
2024
if(this.HP<=0)

0 commit comments

Comments
 (0)