Compare commits

...

3 commits

Author SHA1 Message Date
249f3749b9 switch circle modes with left 2025-11-10 03:51:08 -03:00
8aff822362 add Object:is() to luals definition 2025-11-10 03:50:49 -03:00
bd288099d2 change line style 2025-11-10 03:50:29 -03:00
3 changed files with 15 additions and 0 deletions

View file

@ -21,4 +21,9 @@ function Object:extend() end
---@param mixin table ---@param mixin table
function Object:implement(mixin) end function Object:implement(mixin) end
---Checks if object is of a specific type
---@param object Object
---@return boolean
function Object:is(object) end
return Object return Object

View file

@ -23,6 +23,7 @@ Circle = require 'obj/game/Circle'
function love.load() function love.load()
-- screen setup -- screen setup
love.graphics.setDefaultFilter("nearest") love.graphics.setDefaultFilter("nearest")
love.graphics.setLineStyle("rough")
resize(2) resize(2)
---@type Room|nil ---@type Room|nil

View file

@ -24,6 +24,15 @@ function Stage:update(dt)
end end
end end
if input:pressed('left') then
for _, game_object in ipairs(self.area.game_objects) do
if game_object:is(Circle) then
---@cast game_object Circle
if game_object.mode == "fill" then game_object.mode = "line" else game_object.mode = "fill" end
end
end
end
self.timer:update(dt) self.timer:update(dt)
end end