Add weapon to Ebi.
This commit is contained in:
parent
0db42e8c87
commit
c46ee29caa
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user