29 lines
661 B
Lua
29 lines
661 B
Lua
---@class CircleRoom:Room
|
|
---@field circle Circle
|
|
---@field super Room
|
|
---@field radtween number
|
|
---@field timer Timer
|
|
local CircleRoom = Room:extend()
|
|
|
|
function CircleRoom:new()
|
|
CircleRoom.super.new(self)
|
|
self.radtween = 50
|
|
self.circle = Circle{radius = self.radtween}
|
|
self.timer = Timer()
|
|
end
|
|
|
|
function CircleRoom:update(dt)
|
|
CircleRoom.super.update(self, dt)
|
|
if input:pressed('action') then
|
|
self.timer:tween(1, self.circle, {radius = 100}, 'in-out-cubic')
|
|
end
|
|
self.circle:update(dt)
|
|
self.timer:update(dt)
|
|
end
|
|
|
|
function CircleRoom:draw()
|
|
CircleRoom.super.draw(self)
|
|
self.circle:draw()
|
|
end
|
|
|
|
return CircleRoom
|