-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
46 lines (36 loc) · 1.18 KB
/
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
require("components")
local sti = require("lib/sti")
local camera = require("lib/camera")
local lovebird = require("lib/lovebird")
local Concord = require("lib/concord")
local log = require("lib/log")
local inspect = require("lib/inspect")
local util = require("util")
local MoveSystem = require("systems.move")
local DrawSystem = require("systems.draw")
local CollisionSystem = require("systems.collision")
local FoodSystem = require("systems.food")
local SoundEffectSystem = require("systems.soundeffect")
-- Create the World
local gameworld = Concord.world()
gameworld:addSystem(MoveSystem)
gameworld:addSystem(DrawSystem)
gameworld:addSystem(CollisionSystem)
gameworld:addSystem(FoodSystem)
gameworld:addSystem(SoundEffectSystem)
local camera = camera(0,0)
gameworld:setResource("camera", camera)
util.load_map("levels/testmap.lua", gameworld)
function love.load()
love.window.setMode(800,600, {msaa = 8})
--love.graphics.setDefaultFilter("nearest", "nearest")
-- Load objects and player from the map, create their entities
end
-- Emit the events
function love.update(dt)
lovebird.update()
gameworld:emit("update", dt)
end
function love.draw()
gameworld:emit("draw")
end