exercise 48

This commit is contained in:
yuki 2025-11-10 03:05:54 -03:00
parent 40fe3c84cf
commit 2a41828540

View file

@ -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()