-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
44 lines (31 loc) · 932 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
-- lfg demo
local lfg = require "lfg"
function love.load()
assert(lfg.init({map_file="map_lfg_demo.lua"}))
local minotaur = lfg.get_character("Minotaur") -- or "Skeleton" or "Zombie"
local spell = lfg.get_spell("Fireball") -- or "Lightning" or "Channel", etc
local player_obj = lfg.player_obj or {}
player_obj.name ="Player foo"
player_obj.char = minotaur
player_obj.x = 25 -- x in tiles
player_obj.y = 25 -- y in tiles
player_obj.map_inputs = true
player_obj.spell = spell
local player = lfg.Entity:new(player_obj)
lfg.set_player(player)
lfg.dbg("PLAYER IS:")
lfg.pp(player)
end
-- or: love.update = lfg.update
function love.update(dt)
lfg.update(dt)
end
-- or: love.draw = lfg.draw
function love.draw()
lfg.draw()
end
-- or: love.mousemoved = lfg.mousemoved
function love.mousemoved(...)
lfg.mousemoved(...)
end
love.mousepressed = lfg.mousepressed