-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.lua
48 lines (36 loc) · 1.07 KB
/
game.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
local _M = {}
local ResourceManager = require('resource_manager')
local ResourseDefinitions = require('resource_definitions')
local resource_definitions = {
logo = {
type = ResourceManager.RESOURCE_TYPE_IMAGE,
fileName = 'logo.png',
width = 60,
height = 60,
},
}
function new()
local game = {}
local function resource_definitions_load(resources)
for i, res in pairs(resource_definitions) do
ResourseDefinitions:set(i, res)
end
end
function game:logo_load()
self.logo = ResourceManager:get('logo')
self.logo_prop = MOAIProp2D.new()
self.logo_prop:setDeck(game.logo)
self.logo_prop:setLoc(0, 0)
self.layer:insertProp(game.logo_prop)
end
function game:initialize(viewport)
self.layer = MOAILayer2D.new()
self.layer:setViewport(viewport)
MOAISim.pushRenderPass(self.layer)
resource_definitions_load(resource_definitions)
self:logo_load()
end
return game
end
_M.new = new
return _M