~technomancy/tremendous-quest-iv

tremendous-quest-iv/main.lua -rw-r--r-- 1.3 KiB
a3c24536Phil Hagelberg Bump to Fennel 0.9.1; fix some bugs. 5 months ago
                                                                                
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
require "metatable_monkey" -- must be done before anything else loads
local fennel_module = "polywell.lib.fennel"
fennel = require(fennel_module)
debug.traceback = fennel.traceback
table.insert(package.loaders, 1, fennel.make_searcher({correlate=true,
                                                       useMetadata=true,
                                                       moduleName = fennel_module}))
fennel.path = love.filesystem.getSource() .. "/?.fnl;" ..
   love.filesystem.getSource() .. "/?/init.fnl;" .. fennel.path
local fennelview = require("polywell.lib.fennelview")
_G.pp = function(x) print(fennelview(x)) end

local outer_repl = require("lib.stdio")

editor = require("polywell")
lume = require("polywell.lib.lume")
editor["set-scale"](2)

_G["release?"] = love.filesystem.getSource():match("love$")
-- dbg will print in dev mode but not when running from a .love file
dbg = _G["release?"] and function() end or print

-- sets up handlers for key, mouse, etc
lume.extend(love, editor.handlers)
love.draw = editor.draw

love.load = function()
   local font = love.graphics.newFont("assets/Dogica Pixel.ttf", 8)
   font:setLineHeight(2)
   love.graphics.setFont(font)
   love.keyboard.setTextInput(true)
   require("env").init()
   outer_repl.start()
end

assert(love._version_major ~= 0, "This game requires love 11.x or greater!")