Compare commits
3 commits
4a153e6bda
...
249f3749b9
| Author | SHA1 | Date | |
|---|---|---|---|
| 249f3749b9 | |||
| 8aff822362 | |||
| bd288099d2 |
3 changed files with 15 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
1
main.lua
1
main.lua
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue