modules/scene: better comments and organisation

This commit is contained in:
Kazhnuz 2019-04-11 17:03:53 +02:00
parent ab6475b3cf
commit 33143a0ba3

View file

@ -25,9 +25,13 @@
local cwd = (...):gsub('%.scenes$', '') .. "."
local Scene = Object:extend()
local Assets = require(cwd .. "assets")
local MenuSystem = require(cwd .. "menusystem")
-- INIT FUNCTIONS
-- Initialize and configure the scene
function Scene:new()
self.mouse = {}
self.mouse.x, self.mouse.y = core.screen:getMousePosition()
@ -46,10 +50,20 @@ function Scene:register()
core.scenemanager:setScene(self)
end
function Scene:clear()
-- TODO: send automatic cleanups to the different elements of the scene
end
-- UPDATE FUNCTIONS
-- Handle stuff that happens every steps
function Scene:update(dt)
-- Empty function, is just here to avoid crash
end
-- MOUSE FUNCTIONS
-- Make the scene support the pointer
function Scene:mousemoved(x, y, dx, dy)
-- Empty function, is just here to avoid crash
end
@ -58,13 +72,15 @@ function Scene:mousepressed( x, y, button, istouch )
-- Empty function, is just here to avoid crash
end
-- DRAW FUNCTIONS
-- Draw the scene and its content
function Scene:draw()
end
function Scene:clear()
end
-- KEYBOARD FUNCTIONS
-- Handle inputs from keyboard/controllers
function Scene:setKeys()
if (self.inputLocked) then