diff --git a/event.lua b/event.lua index e518d40..fe294eb 100644 --- a/event.lua +++ b/event.lua @@ -1,9 +1,6 @@ -- ubiquitousse.event local uqt = require((...):match("^(.-ubiquitousse)%.")) local m = uqt.module -local input = uqt.input -local time = uqt.time -local scene = uqt.scene --- The events: callback functions that will be called when something interesting occurs. -- Theses are expected to be redefined in the game. @@ -18,15 +15,15 @@ return { -- @tparam number dt time since last call, in miliseconds -- @impl mixed update = function(dt) - if m.input then input.update(dt) end - if m.time then time.update(dt) end - if m.scene then scene.update(dt) end + if m.input then uqt.input.update(dt) end + if m.time then uqt.time.update(dt) end + if m.scene then uqt.scene.update(dt) end end, --- Called each time the game expect a new frame to be drawn. -- The screen is expected to be cleared since last frame. -- @impl backend draw = function() - if m.scene then scene.draw() end + if m.scene then uqt.scene.draw() end end } diff --git a/input.lua b/input.lua index 080ce34..eb23060 100644 --- a/input.lua +++ b/input.lua @@ -1,6 +1,5 @@ -- ubiquitousse.input local uqt = require((...):match("^(.-ubiquitousse)%.")) -local draw = uqt.draw --- Used to store inputs which were updated this frame -- { Input: true, ... } @@ -263,6 +262,7 @@ input = { -- @tretrun PointerInput the object -- @impl ubiquitousse pointer = function(...) + local draw = uqt.draw -- requires width and height local pointers = {} -- pointers list local x, y = 0, 0 -- pointer position local width, height = 1, 1 -- half-dimensions of the movement area diff --git a/scene.lua b/scene.lua index 8099a05..6b96993 100644 --- a/scene.lua +++ b/scene.lua @@ -1,7 +1,6 @@ -- ubiquitousse.scene local uqt = require((...):match("^(.-ubiquitousse)%.")) local m = uqt.module -local time = uqt.time --- Returns the file path of the given module name. local function getPath(modname) @@ -53,7 +52,7 @@ scene = { return { name = name or "unamed", -- The scene name. - time = m.time and time.new(), -- Scene-specific TimerRegistry, if uqt.time is enabled. + time = m.time and uqt.time.new(), -- Scene-specific TimerRegistry, if uqt.time is enabled. enter = function(self, ...) end, -- Called when entering a scene. exit = function(self) end, -- Called when exiting a scene, and not expecting to come back (scene may be unloaded).