-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
42 lines (32 loc) · 903 Bytes
/
main.lua
File metadata and controls
42 lines (32 loc) · 903 Bytes
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
_G.love = require "love"
local game_selector = require "mini_games.selector"
local shader = require "shader"
local controls = require "controls"
-- full screen timer
local fs_timer = 0
function love.load()
love.graphics.setDefaultFilter("nearest", "nearest")
love.graphics.setFont(love.graphics.newFont("assets/fonts/daydream.otf", 32))
game_selector.load()
controls.load()
shader.load()
end
function love.update(dt)
-- Quit game
if love.keyboard.isDown("escape") then
love.event.quit()
end
-- Change from or to fullscreen
fs_timer = fs_timer + 1
if love.keyboard.isDown("f11") and fs_timer > 30 then
love.window.setFullscreen(not love.window.getFullscreen())
fs_timer = 0
end
game_selector.update(dt)
shader.update(dt)
end
function love.draw()
shader:draw(function()
game_selector.draw()
end)
end