-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.lua
53 lines (40 loc) · 1.08 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
require "libs.strict"
require "libs.imgui"
require "libs.slam"
screenshot = require "misc.screenshot"
no_game_code = nil
common = nil
Gamestate = require "libs.hump.gamestate"
states = {}
levels = {}
Animations_legacy_support = true
function loadLevels()
local lfs = love.filesystem
levels = lfs.getDirectoryItems("levels")
table.sort(levels, function(a,b) return tonumber(a:match("%d+")) < tonumber(b:match("%d+")) end)
for i,v in ipairs(levels) do
print(tostring(v))
end
end
function love.load()
-- set the icon
local icon = love.graphics.newImage("assets/graphics/icon.png")
print (icon)
-- love.graphics.setIcon (icon)
math.randomseed(os.time())
math.random();math.random();math.random()
states.start = require "states.start"
states.game = require "states.game"
states.editor = require "states.editor"
states.lose = require "states.lose"
states.win = require "states.win"
states.selection = require "states.selection"
loadLevels()
Gamestate.registerEvents()
Gamestate.switch(states.start)
end
function love.keypressed(key)
if key == "f12" then
screenshot()
end
end