forked from Snuux/Codeworld
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
72 lines (55 loc) · 1.58 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
State = require 'libs.hump.gamestate'
Timer = require 'libs.hump.timer'
Class = require 'libs.middleclass'
Slib = require 'libs.slib'
ophysics = require 'libs.ophysics'
Particles = require 'libs.particles'
gui = require 'libs.Quickie'
require 'libs.loveframes'
flux = require "libs.flux"
GameState = require "code.states.GameState"
Block = require "code.Block"
Player = require "code.Player"
Turret = require "code.Turret"
Editor = require "code.Editor"
function love.load()
State.registerEvents()
--WINDOW SETTINGS
love.window.setMode(800, 600, {resizable=true, vsync=false, minwidth=400, minheight=300})
WIDTH, HEIGHT = love.window.getMode()
--FONTS
font = {
[12] = love.graphics.newFont(12),
[16] = love.graphics.newFont(16),
[20] = love.graphics.newFont(20),
[85] = love.graphics.newFont(85)
}
love.graphics.setFont(font[12])
Slib.init('Slib')
State.switch(GameState)
end
function love.update(dt)
Timer.update(dt)
loveframes.update(dt)
end
function love.draw(dt)
love.graphics.setBackgroundColor(198, 198, 198, 150)
end
function love.mousepressed(x, y, button)
loveframes.mousepressed(x, y, button)
end
function love.mousereleased(x, y, button)
loveframes.mousereleased(x, y, button)
end
function love.keypressed(key, unicode)
loveframes.keypressed(key, unicode)
end
function love.keyreleased(key)
loveframes.keyreleased(key)
end
function love.textinput(text)
loveframes.textinput(text)
end
function love.resize( w, h )
WIDTH, HEIGHT = w, h
end