diff --git a/src/Bullet.lua b/src/Bullet.lua index d44177d..3ad0e98 100644 --- a/src/Bullet.lua +++ b/src/Bullet.lua @@ -1,6 +1,6 @@ local defaultSpeed = 540/3*2 -local function Bullet(x, y, w, h, speed, color) +local function Bullet(x, y, w, h, speed, color, update) self = {} self.x = x or 0 @@ -11,7 +11,7 @@ local function Bullet(x, y, w, h, speed, color) if not speed then speed = defaultSpeed end --self.speed = speed or player.speed - self.update = function(self, dt) + self.update = update or function(self, dt) self.x = self.x + speed * dt end diff --git a/src/main.lua b/src/main.lua index 63a0df0..9d69ef5 100644 --- a/src/main.lua +++ b/src/main.lua @@ -21,7 +21,7 @@ local function outOfBounds(e) -- everything once it reaches the far left is dead --if e.x < e.w / 2 or e.y < e.h / 2 or e.y > lg.getHeight() + e.h / 2 then - if e.x < e.w / 2 then + if e.x < -e.w / 2 then return true end end