-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.lua
executable file
·46 lines (36 loc) · 949 Bytes
/
main.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
local love = require('love')
-- load libraries
require("modules.lovedebug.lovedebug")
-- load local modules
GAME = require("src.game")
-- load main ECS libs
ECS = {}
ECS.Component = require("modules.Concord.concord.component")
ECS.System = require("modules.Concord.concord.system")
ECS.World = require("modules.Concord.concord.world")
ECS.Entity = require("modules.Concord.concord.entity")
-- load ECS tables
COMPONENTS = require("src.components")
SYSTEMS = require("src.systems")
WORLDS = require("src.worlds")
ENTITIES = require("src.entities")
-- CONSTANTS
CONST = {}
-- initial load func
function love.load()
GAME.current = WORLDS.start()
end
-- main loop
function love.update(dt)
GAME.current:emit("update", dt)
end
-- draw loop
function love.draw()
GAME.current:emit("draw")
end
function love.keypressed(key)
GAME.current:emit("keypressed", key)
end
function love.keyreleased(key)
GAME.current:emit("keyreleased", key)
end