-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.lua
More file actions
30 lines (24 loc) · 967 Bytes
/
main.lua
File metadata and controls
30 lines (24 loc) · 967 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
require "debugger"
require "prism"
prism.loadModule("prism/spectrum")
prism.loadModule("prism/geometer")
prism.loadModule("prism/extra/sight")
prism.loadModule("modules/game")
-- Used by Geometer for new maps
prism.defaultCell = prism.cells.Pit
-- Load a sprite atlas and configure the terminal-style display,
love.graphics.setDefaultFilter("nearest", "nearest")
local spriteAtlas = spectrum.SpriteAtlas.fromASCIIGrid("display/wanderlust_16x16.png", 16, 16)
local display = spectrum.Display(81, 41, spriteAtlas, prism.Vector2(16, 16))
-- Automatically size the window to match the terminal dimensions
display:fitWindowToTerminal()
-- spin up our state machine
--- @type GameStateManager
local manager = spectrum.StateManager()
-- we put out levelstate on top here, but you could create a main menu
--- @diagnostic disable-next-line
function love.load()
manager:push(spectrum.gamestates.GameLevelState(display))
manager:hook()
spectrum.Input:hook()
end