-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.lua
113 lines (97 loc) · 2.76 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
--
-- main.lua
-- Main entry-point for the file.
--
-- ========================
--
-- GLOBAL LIBRARIES/CLASSES
--
-- ========================
Class = require('vendor/nomoon/class')
Set = require('vendor/nomoon/set')
JSON = require('vendor/dkjson')
SLAXML = require('vendor/slaxml/slaxdom')
Sfxr = require('vendor/sfxr')
LPegLJ = require('vendor/lpeglj/lpeglj')
-- Kikito's best libraries
kikito = {
anim8 = require('vendor/kikito/anim8'),
bump = require('vendor/kikito/bump'),
inspect = require('vendor/kikito/inspect'),
loader = require('vendor/kikito/love-loader'),
md5 = require('vendor/kikito/md5'),
sha1 = require('vendor/kikito/sha1'),
tween = require('vendor/kikito/tween')
}
-- Parts of the HUMP library
hump = {
Camera = require('vendor/hump/camera'),
GS = require('vendor/hump/gamestate'),
Signal = require('vendor/hump/signal'),
Timer = require('vendor/hump/timer'),
Vector = require('vendor/hump/vector')
}
-- Helper methods
serialize = require('vendor/ser')
inspect = kikito.inspect
math.round = require('vendor/nomoon/round')
--[[ .... ]] require('vendor/deepcopy') -- table.deepcopy
table.copy = table.deepcopy
-- ========================
--
-- LÖVE2D ENGINE/GAME STUFF
--
-- ========================
-- This table can store important "global" objects for the game
-- (and keep the global namespace cleaner)
game = {
states = {},
objects = {},
graphics = {} -- Just some ideas...
}
-- conf.lua -- Initial configuration (already loaded)
-- Exports:
-- love.conf(t) - ran already
-- conf (table of love configuration settings)
-- debug.lua -- Debug flags/output for Love2d
-- Exports:
-- love.debug, etc. (see file)
require('love/debug')
love.debug.setFlag('all') -- Comment this out to stop seeing everything.
-- load.lua -- Loaded on game start
-- Exports:
-- love.load()
require('love/load')
-- update.lua -- Update method
-- Exports:
-- love.update(dt)
require('love/update')
-- draw.lua -- Draw method
-- Exports:
-- love.viewport -- Viewport singleton
-- love.draw()
require('love/draw')
-- input.lua -- Input callbacks
-- Exports:
-- love.inputman -- InputMan singleton
-- love.inputpressed(state, value)
-- love.inputreleased(state, value)
-- love.joystickadded(k)
-- love.joystickremoved(j)
require('love/input')
-- sound.lua -- Sound methods
-- Exports:
-- love.soundman -- SoundMan singleton
require('love/sound')
-- events.lua -- Love2d Event processing
-- Exports:
-- love.processevents()
require('love/events')
-- misc.lua -- Miscellaneous Love2d events
-- Exports:
-- love.threaderror(thread, errorstr)
require('love/misc')
-- run.lua -- Main loop
-- Exports:
-- love.run()
require('love/run')