Engine 0.0.4
Game engine in lua
Loading...
Searching...
No Matches
game.lua
Go to the documentation of this file.
1--! @defgroup std
2--! @{
3--! @defgroup game
4--! @{
5
6local function reset(self)
7 return function()
8 if self.callbacks.exit then
9 self.callbacks.exit(self.std, self.game)
10 end
11 if self.callbacks.init then
12 self.callbacks.init(self.std, self.game)
13 end
14 end
15end
16
17local function exit(self)
18 return function()
19 if self.callbacks.exit then
20 self.callbacks.exit(self.std, self.game)
21 end
22 if self.exit then
23 self.exit()
24 end
25 end
26end
27
28--! @}
29--! @}
30
31--! @cond
32local function install(std, game, application, exit_func)
33 std = std or {}
34 std.game = std.game or {}
35 local app = {
36 callbacks=application.callbacks,
37 exit=exit_func,
38 std=std,
40 }
41 std.game.reset = reset(app)
42 std.game.exit = exit(app)
43 return std.game
44end
45--! @endcond
46
47local P = {
49}
50
51return P
local function reset(self)
local application
Definition main.lua:16
local game
Definition main.lua:17
local std
Definition main.lua:18
local function install(std, lgame, application, ginga)
local function init(std, game)
local function exit(std, game)