diff --git a/obj/game/Player.lua b/obj/game/Player.lua index ce6096b..94ad200 100644 --- a/obj/game/Player.lua +++ b/obj/game/Player.lua @@ -27,6 +27,8 @@ function Player:new(area, x, y, opts) self.max_v = 100 -- player acceleration self.a = 100 + + self.timer:every(4, function() self:shoot() end) end function Player:update(dt) @@ -36,7 +38,6 @@ function Player:update(dt) -- controls if input:down('left') then self.r = self.r - self.rv*dt end if input:down('right') then self.r = self.r + self.rv*dt end - if input:pressed('action') then self:shoot() end -- update velocity self.v = math.min(self.v + self.a*dt, self.max_v)