-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
32 lines (27 loc) · 937 Bytes
/
Copy pathmain.lua
File metadata and controls
32 lines (27 loc) · 937 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
local Gamestate = require "gamestate"
local images = {}
local fonts = {}
local tiles = {}
local function loadTiles()
tiles.grass = love.graphics.newImage("assets/tiles/grass.jpg")
tiles.grass:setFilter("nearest", "nearest")
end
local function loadFonts()
fonts.main = love.graphics.newFont("assets/fonts/DejaVuSans.ttf", 16)
fonts.title = love.graphics.newFont("assets/fonts/DejaVuSans.ttf", 24)
love.graphics.setFont(fonts.main)
end
local function loadSprites()
images.player = love.graphics.newImage("assets/sprites/player.png")
images.flag = love.graphics.newImage("assets/sprites/flag.png")
images.player:setFilter("nearest", "nearest")
images.flag:setFilter("nearest", "nearest")
end
function love.load()
love.window.setTitle("10-Level Ability Game")
loadFonts()
loadTiles()
loadSprites()
Gamestate.registerEvents()
Gamestate.switch(require("states.menu"), images, fonts, tiles)
end