-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.moon
More file actions
42 lines (30 loc) · 854 Bytes
/
main.moon
File metadata and controls
42 lines (30 loc) · 854 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
require "lovekit.all"
if pcall(-> require"inotify")
require "lovekit.reloader"
{graphics: g} = love
import MidiController from require "midi"
load_font = (img, chars)->
font_image = imgfy img
g.newImageFont font_image.tex, chars
class MainDispatch extends Dispatcher
new: (...) =>
super ...
@viewport = EffectViewport {
pixel_scale: true
crop: true
scale: GAME_CONFIG.scale
}
mouse_pos: =>
x, y = love.mouse.getPosition!
@viewport\unproject x, y
love.load = ->
fonts = {
default: load_font "images/font.png",
[[ abcdefghijklmnopqrstuvwxyz-1234567890!.,:;'"?$&]]
}
g.setFont fonts.default
g.setBackgroundColor 10, 10, 10
import Mursic from require "mursic"
export DISPATCHER = MainDispatch Mursic!
-- DISPATCHER.default_transition = FadeTransition
DISPATCHER\bind love