Added module system

This commit is contained in:
MaddoScientisto 2024-04-22 21:54:00 +02:00
commit 86722ea10e
3 changed files with 109 additions and 44 deletions

View file

@ -1,5 +1,7 @@
--[[pod_format="raw",created="2024-04-14 14:05:11",modified="2024-04-21 21:31:12",revision=319]]
--[[pod_format="raw",created="2024-04-14 14:05:11",modified="2024-04-22 19:53:44",revision=324]]
--include("/cirnofarm/src/actor.lua")
last_coll=0
mouse_debug = true
w=480
@ -48,7 +50,7 @@ function create_bullet(new_x,new_y)
})
end
function _init()
function cirno_init()
bullets={}
player={}
@ -114,7 +116,7 @@ function _init()
end
function _draw()
function cirno_draw()
cls(0)
--camera(x - 240, y - 135)
@ -150,7 +152,7 @@ function drawMap()
end
end
function _update()
function cirno_update()
for p in all(player) do
p:update()
end
@ -256,4 +258,21 @@ function cmap(o)
end
return ct or cb
end
end
M = {}
function M.init()
return cirno_init()
end
function M.update()
return cirno_update()
end
function M.draw()
return cirno_draw()
end
return M

8
src/strawberry.lua Normal file
View file

@ -0,0 +1,8 @@
--[[pod_format="raw",created="2024-04-22 19:32:54",modified="2024-04-22 19:53:44",revision=3]]
M = {}
function M.func()
print("inside module.func()")
end
return M