1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
(use-modules (2d agenda) (2d fps) (2d game) (2d keyboard) (2d window) (2d repl server)) (spawn-server) (add-hook! key-press-hook (lambda (key unicode) (when (eq? key 'escape) (quit-game)))) (add-hook! window-close-hook quit-game) (schedule-interval game-agenda (lambda () (display (fps)) (newline)) 60)