--cd("/cirnofarm/src") --include("/cirnofarm/src/cirno.lua") function make_path(name) local base_path = "/cirnofarm/src/" -- Change this when releasing return base_path .. name end local _modules = {} function loadfile (filename) local src = fetch(filename) if (type(src) ~= "string") then notify("could not include "..filename) stop() return end -- https://www.lua.org/manual/5.4/manual.html#pdf-load -- chunk name (for error reporting), mode ("t" for text only -- no binary chunk loading), _ENV upvalue -- @ is a special character that tells debugger the string is a filename local func,err = load(src, "@"..filename, "t", _ENV) -- syntax error while loading if (not func) then send_message(3, {event="report_error", content = "*syntax error"}) send_message(3, {event="report_error", content = tostr(err)}) stop() return end return func end function require(name) local already_imported = _modules[name] if already_imported ~= nil then return already_imported end local filename = fullpath(name:gsub ('%.', '/') ..'.lua') local func = loadfile (filename) local module = func(name) _modules[name]=module return module end --local strawberry = require(make_path("strawberry")) --strawberry.func() local cirno = require(make_path("cirno")) local mouse_debug = require(make_path("mouse_debug")) tile_width = 16 tile_height = 16 function _init() cirno.init() end function _update() cirno.update() end function _draw() cirno.draw() mouse_debug.draw(3, tile_width, tile_height) end