-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
44 lines (36 loc) · 1017 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
local Gamestate = require('vendor/gamestate')
local Player = require('src/entities/player')
local Bullet = require('src/entities/bullet')
local Enemy = require('src/entities/enemy')
local Explosion = require('src/entities/explosion')
local Gem = require('src/entities/gem')
local media = require('src/media')
local shaders = require('src/shaders')
local menu = require('src/states/menu')
local game = require('src/states/game')
function love.load ()
love.mouse.setVisible(false)
shaders.load()
media.loadImageFonts()
media.loadBackgroundImages()
media.loadBackgroundPlaylist()
Player.loadAssets()
Bullet.loadAssets()
Enemy.loadAssets()
Explosion.loadAssets()
Gem.loadAssets()
Gamestate.registerEvents()
Gamestate.switch(menu)
end
function love.keypressed (key)
if key == 'lcmd' and key == 'q' then
love.event.push('quit')
end
if key == 'return' then
if Gamestate.current() ~= menu then
Gamestate.switch(menu)
else
Gamestate.switch(game)
end
end
end