diff --git a/src/enemy/ebi.lua b/src/enemy/ebi.lua index 5b4f04c..026c2c6 100644 --- a/src/enemy/ebi.lua +++ b/src/enemy/ebi.lua @@ -18,6 +18,8 @@ function Ebi:init() dir = -1 end self.vector = {x=0, y=dir} + + self:weaponTimer() end function Ebi:update() @@ -28,3 +30,14 @@ function Ebi:update() end end end + +function Ebi:weaponTimer() + local t = playdate.timer.new(1000, + function() + local b = Bullet(2, 1, {x=-1, y=0}, 0x2) + b:moveTo(self.x - (self.width/2) - 1, self.y) + b:add() + end + ) + t.repeats = true +end