diff --git a/rooms/Stage.lua b/rooms/Stage.lua index 1b07d92..7668c01 100644 --- a/rooms/Stage.lua +++ b/rooms/Stage.lua @@ -1,9 +1,14 @@ ---@class Stage:Room +---@field timer Timer local Stage = Room:extend() function Stage:new() Stage.super.new(self) self.timer = Timer() + self.timer:every(2, function() + local latest_object = self.area:addGameObject('Circle', love.math.random(1, 800), love.math.random(1, 600)) + latest_object.timer:after(love.math.random(2, 4), function() latest_object:kill() end) + end) end function Stage:update(dt) @@ -18,6 +23,8 @@ function Stage:update(dt) game_object:kill() end end + + self.timer:update(dt) end function Stage:draw()