From 2e56bb6a0c7210c8103eb43895b180c1125291ac Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 15 May 2016 21:32:58 -0400 Subject: Use proper asset path and launcher binary. --- .gitignore | 2 + Makefile.am | 6 +- configure.ac | 8 ++ game.scm | 348 ------------------------------------------------ guix.scm | 4 +- lisparuga/config.scm.in | 22 +++ lisparuga/game.scm | 329 +++++++++++++++++++++++++++++++++++++++++++++ lisparuga/view.scm | 18 ++- pre-inst-env.in | 5 +- scripts/lisparuga.in | 43 ++++++ 10 files changed, 430 insertions(+), 355 deletions(-) delete mode 100644 game.scm create mode 100644 lisparuga/config.scm.in create mode 100644 lisparuga/game.scm create mode 100644 scripts/lisparuga.in diff --git a/.gitignore b/.gitignore index be2aba4..16e986d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ /dist/ *.go *.tar.gz +/lisparuga/config.scm +/scripts/lisparuga diff --git a/Makefile.am b/Makefile.am index efc0a1e..7842a3f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,7 +36,11 @@ SUFFIXES = .scm .go moddir=$(prefix)/share/guile/site/$(GUILE_EFFECTIVE_VERSION) godir=$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/ccache +bin_SCRIPTS = \ + scripts/lisparuga + SOURCES = \ + lisparuga/config.scm \ lisparuga/utils.scm \ lisparuga/audio.scm \ lisparuga/bullets.scm \ @@ -46,7 +50,7 @@ SOURCES = \ lisparuga/stats.scm \ lisparuga/world.scm \ lisparuga/view.scm \ - game.scm + lisparuga/game.scm imagesdir = $(pkgdatadir)/images dist_images_DATA = \ diff --git a/configure.ac b/configure.ac index d898a1c..18e80a1 100644 --- a/configure.ac +++ b/configure.ac @@ -9,6 +9,14 @@ AM_SILENT_RULES([yes]) AC_PATH_PROG([GUILE], [guile]) AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env]) +AC_CONFIG_FILES([scripts/lisparuga], [chmod +x scripts/lisparuga]) +AC_CONFIG_FILES([lisparuga/config.scm]) + +# Prepare a version of $datadir that does not contain references to +# shell variables. +lisparuga_prefix="`eval echo $prefix | sed -e"s|NONE|/usr/local|g"`" +lisparuga_datadir="`eval eval echo $datadir | sed -e "s|NONE|$lisparuga_prefix|g"`" +AC_SUBST([lisparuga_datadir]) GUILE_PKG([2.2 2.0]) GUILE_PROGS diff --git a/game.scm b/game.scm deleted file mode 100644 index e08b110..0000000 --- a/game.scm +++ /dev/null @@ -1,348 +0,0 @@ -;;; Lisparuga -;;; Copyright © 2016 David Thompson -;;; -;;; Lisparuga is free software: you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published -;;; by the Free Software Foundation, either version 3 of the License, -;;; or (at your option) any later version. -;;; -;;; Lisparuga is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with Lisparuga. If not, see . - -(use-modules (ice-9 format) - (ice-9 match) - (sly) - (sly actor) - (sly audio) - (sly fps) - (sly render framebuffer) - (sly render sprite-batch) - (sly render tileset) - (srfi srfi-1) - (lisparuga audio) - (lisparuga bullets) - (lisparuga enemies) - (lisparuga explosions) - (lisparuga player) - (lisparuga stats) - (lisparuga utils) - (lisparuga view) - (lisparuga world)) - - -;;; -;;; Controller -;;; - -(define-signal timer (signal-timer)) - -(define-signal world - (signal-fold world-eval - %default-world - (signal-merge - (make-signal '(null)) - (signal-let ((time timer)) - `(tick ,time)) - (signal-let ((direction key-arrows)) - `(player-direction ,direction)) - (signal-let ((shoot? (signal-drop-repeats (key-down? 'z)))) - `(player-shoot ,shoot?)) - (signal-let ((toggle? - (signal-filter identity #f - (signal-drop-repeats - (key-down? 'x))))) - `(player-toggle-polarity)) - (signal-let ((restart? (key-down? 'return))) - `(restart ,restart?))))) - -(define-signal display-fps? (key-toggle 'f)) - - -;;; -;;; Music and Sound -;;; - -(define-signal music - (signal-drop-repeats - (signal-let ((world world)) - (load-music* (cond - ((game-intro? world) "title-screen.ogg") - ((game-over? world) "ending.ogg") - ((game-won? world) "title-screen.ogg") - (else "level-2.ogg")))))) - - -(define-signal sounds - (on-start - `((enemy-hit . ,(load-sample* "hit.wav")) - (explosion . ,(load-sample* "explosion.wav")) - (player-death . ,(load-sample* "player-death.wav")) - (player-shoot . ,(load-sample* "player-shoot.wav"))))) - -(define-signal sound-effects - (signal-let ((world world) - (time timer) - (sounds sounds)) - (filter-map (lambda (sound-proc) - (let ((sound (sound-proc world time))) - (and sound (assq-ref sounds sound)))) - (list enemy-hit-sound - player-shoot-sound - player-death-sound - explosion-sound)))) - - -;;; -;;; View -;;; - -(define-signal framebuffer - (on-start - (make-framebuffer (vx scaled-resolution) (vy scaled-resolution)))) - -(define-signal framebuffer-sprite - (signal-map-maybe (lambda (framebuffer) - (make-sprite (framebuffer-texture framebuffer) - #:anchor 'bottom-left)) - framebuffer)) - -(define-signal font - (on-start - (load-font "assets/fonts/kenpixel_mini.ttf" 7))) - -(define-signal big-font - (on-start - (load-font "assets/fonts/kenpixel_mini.ttf" 16))) - -(define-signal fps-text - (signal-let ((fps fps) - (font font)) - (if font - (move (vector2 (vx resolution) 0) - (render-sprite - (make-label font - (format #f "~d fps" fps) - #:blended? #f - #:anchor 'bottom-right))) - render-nothing))) - -(define-signal score-text - (signal-let ((font font) - (world world)) - (if font - (move resolution - (render-sprite - (make-label font - (number->string (stats-score (world-stats world))) - #:blended? #f - #:anchor 'top-right))) - render-nothing))) - -(define-signal lives-text - (signal-let ((font font) - (world world)) - (if font - (move (vector2 (/ (vx resolution) 2) (vy resolution)) - (render-sprite - (make-label font - (format #f "~d ship" - (stats-lives (world-stats world))) - #:blended? #f - #:anchor 'top-center))) - render-nothing))) - -(define-signal chain-text - (signal-let ((font font) - (world world)) - (if font - (move (vector2 1 (vy resolution)) - (render-sprite - (make-label font - (format #f "~d chain" - (stats-chain (world-stats world))) - #:blended? #f - #:anchor 'top-left))) - render-nothing))) - -(define-signal status-text - (signal-let ((big-font big-font) - (font font) - (world world)) - (cond - ((or (not font) (not big-font)) - render-nothing) - ((game-over? world) - (move (v* resolution 0.5) - (render-begin - (render-status-text big-font "GAME OVER") - (move (vector2 0 -16) - (render-status-text font "Press ENTER to play again")) - (move (vector2 0 -28) - (render-status-text font "Press ESC to quit"))))) - ((game-won? world) - (move (v* resolution 0.5) - (render-begin - (render-status-text big-font "COMPLETE!") - (move (vector2 0 -16) - (render-status-text font "Press ENTER to play again")) - (move (vector2 0 -28) - (render-status-text font "Press ESC to quit"))))) - ((game-intro? world) - (move (v* resolution (vector2 0.5 0.8)) - (render-begin - (render-status-text font "Use arrow keys to move") - (move (vector2 0 -12) - (render-status-text font "Press Z to shoot")) - (move (vector2 0 -24) - (render-status-text font "Press X to change polarity")) - (move (vector2 0 -36) - (render-status-text font "Press ESC to quit")) - (move (vector2 0 -60) - (render-status-text big-font "Press ENTER"))))) - (else - render-nothing)))) - -(define-signal background - (load-sprite/live "assets/images/background.png" - #:anchor 'bottom-left)) - -(define-signal background-overlay - (load-sprite/live "assets/images/background-overlay.png" - #:anchor 'bottom-left)) - -(define-signal player-tileset - (load-tileset/live "assets/images/player.png" 16 16)) - -(define-signal bullet-tileset - (load-tileset/live "assets/images/bullets.png" 16 16)) - -(define-signal enemy-tileset - (load-tileset/live "assets/images/enemies.png" 16 16)) - -(define-signal explosion-tileset - (load-tileset/live "assets/images/explosion.png" 16 16)) - -(define-signal chain-tileset - (load-tileset/live "assets/images/chain.png" 24 16)) - -(define-signal chain-sprite - (signal-map-maybe (lambda (world tileset) - (let ((stats (world-stats world))) - (if (zero? (stats-chain-progress stats)) - render-nothing - (move (vector2 0 (- (vy resolution) 5)) - (render-sprite - (make-chain-sprite tileset stats)))))) - world - chain-tileset)) - -(define-signal player-sprite - (signal-map-maybe (lambda (world tileset) - (make-sprite - (let* ((player (actor-ref (world-player world))) - (dx (vx (player-direction player))) - (offset (cond - ((zero? dx) 0) - ((positive? dx) 1) - ((negative? dx) 2)))) - (tileset-ref tileset - (+ (match (player-polarity player) - ('light 12) - ('dark 8)) - offset))))) - world - player-tileset)) - -(define-signal scrolling-background - (signal-map render-begin - ;;(make-scrolling-background background timer 0.2) - (render-sprite-maybe background) - (make-scrolling-background background-overlay timer 4))) - -(define-signal batch - (on-start (make-sprite-batch 1000))) - -(define-signal scene - (signal-let ((fps-text fps-text) - (score-text score-text) - (lives-text lives-text) - (chain-text chain-text) - (status-text status-text) - (display-fps? display-fps?) - (background scrolling-background) - (framebuffer framebuffer) - (framebuffer-sprite framebuffer-sprite) - (player-sprite player-sprite) - (chain-sprite chain-sprite) - (bullet-tileset bullet-tileset) - (enemy-tileset enemy-tileset) - (explosion-tileset explosion-tileset) - (batch batch) - (world world) - (time timer)) - (if (and framebuffer framebuffer-sprite batch bullet-tileset - enemy-tileset player-sprite explosion-tileset chain-sprite) - (let ((player (actor-ref (world-player world)))) - (render-begin - (with-framebuffer framebuffer - (with-camera camera - (render-begin - background - (render-explosions (world-explosions world) - explosion-tileset - batch - time) - (render-bullets (world-player-bullets world) - bullet-tileset - batch) - (if (game-over? world) - render-nothing - (render-player player player-sprite time)) - (render-enemies (world-enemies world) - enemy-tileset - batch - time) - (render-bullets (world-enemy-bullets world) - bullet-tileset - batch) - (with-color font-color - (render-begin - (if display-fps? - fps-text - render-nothing) - score-text - lives-text - chain-text - status-text)) - chain-sprite))) - (with-camera scaled-camera - (scale resolution-scale (render-sprite framebuffer-sprite))))) - render-nothing))) - - -;;; -;;; Main -;;; - -(with-window (make-window #:title "lisparuga" - #:resolution scaled-resolution) - (enable-fonts) - (enable-audio) - (add-signal-hook! music loop-music) - (add-signal-hook! sound-effects play-sound-effects) - (add-hook! key-press-hook (lambda (key) - (when (eq? key 'escape) - (stop-game-loop)))) - - (add-hook! window-close-hook stop-game-loop) - (start-sly-repl) - (run-game-loop scene)) - -;;; Local Variables: -;;; compile-command: "../pre-inst-env guile game.scm" -;;; End: diff --git a/guix.scm b/guix.scm index a9136f6..6b1aae4 100644 --- a/guix.scm +++ b/guix.scm @@ -22,9 +22,7 @@ ;; To setup the development environment, run the following: ;; ;; guix environment -l guix.scm -;; ./bootstrap && ./configure \ -;; --with-libfreeimage-prefix=$(guix build freeimage) \ -;; --with-libgslcblas-prefix=$(guix build gsl) +;; ./bootstrap && ./configure; ;; ;; To build the development snapshot, run: ;; diff --git a/lisparuga/config.scm.in b/lisparuga/config.scm.in new file mode 100644 index 0000000..d17db2b --- /dev/null +++ b/lisparuga/config.scm.in @@ -0,0 +1,22 @@ +;;; Lisparuga +;;; Copyright © 2016 David Thompson +;;; +;;; Lisparuga is free software: you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published +;;; by the Free Software Foundation, either version 3 of the License, +;;; or (at your option) any later version. +;;; +;;; Lisparuga is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with Lisparuga. If not, see . + +(define-module (lisparuga config) + #:export (%datadir)) + +(define %datadir + (or (getenv "LISPARUGA_DATADIR") + "@lisparuga_datadir@/lisparuga")) diff --git a/lisparuga/game.scm b/lisparuga/game.scm new file mode 100644 index 0000000..d658419 --- /dev/null +++ b/lisparuga/game.scm @@ -0,0 +1,329 @@ +;;; Lisparuga +;;; Copyright © 2016 David Thompson +;;; +;;; Lisparuga is free software: you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published +;;; by the Free Software Foundation, either version 3 of the License, +;;; or (at your option) any later version. +;;; +;;; Lisparuga is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with Lisparuga. If not, see . + +(define-module (lisparuga game) + #:use-module (ice-9 format) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (sly) + #:use-module (sly actor) + #:use-module (sly audio) + #:use-module (sly fps) + #:use-module (sly render framebuffer) + #:use-module (sly render sprite-batch) + #:use-module (sly render tileset) + #:use-module (lisparuga audio) + #:use-module (lisparuga bullets) + #:use-module (lisparuga enemies) + #:use-module (lisparuga explosions) + #:use-module (lisparuga player) + #:use-module (lisparuga stats) + #:use-module (lisparuga utils) + #:use-module (lisparuga view) + #:use-module (lisparuga world) + #:export (music + sound-effects + scene)) + + +;;; +;;; Controller +;;; + +(define-signal timer (signal-timer)) + +(define-signal world + (signal-fold world-eval + %default-world + (signal-merge + (make-signal '(null)) + (signal-let ((time timer)) + `(tick ,time)) + (signal-let ((direction key-arrows)) + `(player-direction ,direction)) + (signal-let ((shoot? (signal-drop-repeats (key-down? 'z)))) + `(player-shoot ,shoot?)) + (signal-let ((toggle? + (signal-filter identity #f + (signal-drop-repeats + (key-down? 'x))))) + `(player-toggle-polarity)) + (signal-let ((restart? (key-down? 'return))) + `(restart ,restart?))))) + +(define-signal display-fps? (key-toggle 'f)) + + +;;; +;;; Music and Sound +;;; + +(define-signal music + (signal-drop-repeats + (signal-let ((world world)) + (load-music* (cond + ((game-intro? world) "title-screen.ogg") + ((game-over? world) "ending.ogg") + ((game-won? world) "title-screen.ogg") + (else "level-2.ogg")))))) + + +(define-signal sounds + (on-start + `((enemy-hit . ,(load-sample* "hit.wav")) + (explosion . ,(load-sample* "explosion.wav")) + (player-death . ,(load-sample* "player-death.wav")) + (player-shoot . ,(load-sample* "player-shoot.wav"))))) + +(define-signal sound-effects + (signal-let ((world world) + (time timer) + (sounds sounds)) + (filter-map (lambda (sound-proc) + (let ((sound (sound-proc world time))) + (and sound (assq-ref sounds sound)))) + (list enemy-hit-sound + player-shoot-sound + player-death-sound + explosion-sound)))) + + +;;; +;;; View +;;; + +(define-signal framebuffer + (on-start + (make-framebuffer (vx scaled-resolution) (vy scaled-resolution)))) + +(define-signal framebuffer-sprite + (signal-map-maybe (lambda (framebuffer) + (make-sprite (framebuffer-texture framebuffer) + #:anchor 'bottom-left)) + framebuffer)) + +(define-signal font + (on-start + (load-font* "kenpixel_mini.ttf" 7))) + +(define-signal big-font + (on-start + (load-font* "kenpixel_mini.ttf" 16))) + +(define-signal fps-text + (signal-let ((fps fps) + (font font)) + (if font + (move (vector2 (vx resolution) 0) + (render-sprite + (make-label font + (format #f "~d fps" fps) + #:blended? #f + #:anchor 'bottom-right))) + render-nothing))) + +(define-signal score-text + (signal-let ((font font) + (world world)) + (if font + (move resolution + (render-sprite + (make-label font + (number->string (stats-score (world-stats world))) + #:blended? #f + #:anchor 'top-right))) + render-nothing))) + +(define-signal lives-text + (signal-let ((font font) + (world world)) + (if font + (move (vector2 (/ (vx resolution) 2) (vy resolution)) + (render-sprite + (make-label font + (format #f "~d ship" + (stats-lives (world-stats world))) + #:blended? #f + #:anchor 'top-center))) + render-nothing))) + +(define-signal chain-text + (signal-let ((font font) + (world world)) + (if font + (move (vector2 1 (vy resolution)) + (render-sprite + (make-label font + (format #f "~d chain" + (stats-chain (world-stats world))) + #:blended? #f + #:anchor 'top-left))) + render-nothing))) + +(define-signal status-text + (signal-let ((big-font big-font) + (font font) + (world world)) + (cond + ((or (not font) (not big-font)) + render-nothing) + ((game-over? world) + (move (v* resolution 0.5) + (render-begin + (render-status-text big-font "GAME OVER") + (move (vector2 0 -16) + (render-status-text font "Press ENTER to play again")) + (move (vector2 0 -28) + (render-status-text font "Press ESC to quit"))))) + ((game-won? world) + (move (v* resolution 0.5) + (render-begin + (render-status-text big-font "COMPLETE!") + (move (vector2 0 -16) + (render-status-text font "Press ENTER to play again")) + (move (vector2 0 -28) + (render-status-text font "Press ESC to quit"))))) + ((game-intro? world) + (move (v* resolution (vector2 0.5 0.8)) + (render-begin + (render-status-text font "Use arrow keys to move") + (move (vector2 0 -12) + (render-status-text font "Press Z to shoot")) + (move (vector2 0 -24) + (render-status-text font "Press X to change polarity")) + (move (vector2 0 -36) + (render-status-text font "Press ESC to quit")) + (move (vector2 0 -60) + (render-status-text big-font "Press ENTER"))))) + (else + render-nothing)))) + +(define-signal background + (load-sprite/live "background.png" + #:anchor 'bottom-left)) + +(define-signal background-overlay + (load-sprite/live "background-overlay.png" + #:anchor 'bottom-left)) + +(define-signal player-tileset + (load-tileset/live "player.png" 16 16)) + +(define-signal bullet-tileset + (load-tileset/live "bullets.png" 16 16)) + +(define-signal enemy-tileset + (load-tileset/live "enemies.png" 16 16)) + +(define-signal explosion-tileset + (load-tileset/live "explosion.png" 16 16)) + +(define-signal chain-tileset + (load-tileset/live "chain.png" 24 16)) + +(define-signal chain-sprite + (signal-map-maybe (lambda (world tileset) + (let ((stats (world-stats world))) + (if (zero? (stats-chain-progress stats)) + render-nothing + (move (vector2 0 (- (vy resolution) 5)) + (render-sprite + (make-chain-sprite tileset stats)))))) + world + chain-tileset)) + +(define-signal player-sprite + (signal-map-maybe (lambda (world tileset) + (make-sprite + (let* ((player (actor-ref (world-player world))) + (dx (vx (player-direction player))) + (offset (cond + ((zero? dx) 0) + ((positive? dx) 1) + ((negative? dx) 2)))) + (tileset-ref tileset + (+ (match (player-polarity player) + ('light 12) + ('dark 8)) + offset))))) + world + player-tileset)) + +(define-signal scrolling-background + (signal-map render-begin + ;;(make-scrolling-background background timer 0.2) + (render-sprite-maybe background) + (make-scrolling-background background-overlay timer 4))) + +(define-signal batch + (on-start (make-sprite-batch 1000))) + +(define-signal scene + (signal-let ((fps-text fps-text) + (score-text score-text) + (lives-text lives-text) + (chain-text chain-text) + (status-text status-text) + (display-fps? display-fps?) + (background scrolling-background) + (framebuffer framebuffer) + (framebuffer-sprite framebuffer-sprite) + (player-sprite player-sprite) + (chain-sprite chain-sprite) + (bullet-tileset bullet-tileset) + (enemy-tileset enemy-tileset) + (explosion-tileset explosion-tileset) + (batch batch) + (world world) + (time timer)) + (if (and framebuffer framebuffer-sprite batch bullet-tileset + enemy-tileset player-sprite explosion-tileset chain-sprite) + (let ((player (actor-ref (world-player world)))) + (render-begin + (with-framebuffer framebuffer + (with-camera camera + (render-begin + background + (render-explosions (world-explosions world) + explosion-tileset + batch + time) + (render-bullets (world-player-bullets world) + bullet-tileset + batch) + (if (game-over? world) + render-nothing + (render-player player player-sprite time)) + (render-enemies (world-enemies world) + enemy-tileset + batch + time) + (render-bullets (world-enemy-bullets world) + bullet-tileset + batch) + (with-color font-color + (render-begin + (if display-fps? + fps-text + render-nothing) + score-text + lives-text + chain-text + status-text)) + chain-sprite))) + (with-camera scaled-camera + (scale resolution-scale (render-sprite framebuffer-sprite))))) + render-nothing))) diff --git a/lisparuga/view.scm b/lisparuga/view.scm index e43d32e..3afda6c 100644 --- a/lisparuga/view.scm +++ b/lisparuga/view.scm @@ -30,6 +30,7 @@ #:use-module (sly signal) #:use-module (sly utils) #:use-module (lisparuga bullets) + #:use-module (lisparuga config) #:use-module (lisparuga enemies) #:use-module (lisparuga explosions) #:use-module (lisparuga player) @@ -41,6 +42,7 @@ camera scaled-camera font-color + load-font* render-status-text load-sprite/live load-tileset/live @@ -65,14 +67,26 @@ (define font-color (rgb #xdeeed6)) +(define (load-font* file size) + (load-font (string-append %datadir "/fonts/" file) size)) + (define render-status-text (memoize (lambda (font text) (render-sprite (make-label font text #:blended? #f #:anchor 'center))))) -(define load-sprite/live (with-live-reload load-sprite)) -(define load-tileset/live (with-live-reload load-tileset)) +(define (load-sprite* file . keyword-args) + (apply load-sprite + (string-append %datadir "/images/" file) + keyword-args)) + +(define (load-tileset* file width height) + (load-tileset (string-append %datadir "/images/" file) + width height)) + +(define load-sprite/live (with-live-reload load-sprite*)) +(define load-tileset/live (with-live-reload load-tileset*)) (define make-chain-sprite (memoize diff --git a/pre-inst-env.in b/pre-inst-env.in index ae530ee..6deffcc 100644 --- a/pre-inst-env.in +++ b/pre-inst-env.in @@ -23,7 +23,10 @@ GUILE_LOAD_COMPILED_PATH="$abs_top_builddir${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_ GUILE_LOAD_PATH="$abs_top_builddir:$abs_top_srcdir${GUILE_LOAD_PATH:+:}:$GUILE_LOAD_PATH" export GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH -PATH="$abs_top_builddir:$PATH" +PATH="$abs_top_builddir/scripts:$PATH" export PATH +LISPARUGA_DATADIR="$abs_top_builddir/assets" +export LISPARUGA_DATADIR + exec "$@" diff --git a/scripts/lisparuga.in b/scripts/lisparuga.in new file mode 100644 index 0000000..21d1777 --- /dev/null +++ b/scripts/lisparuga.in @@ -0,0 +1,43 @@ +#!@GUILE@ --no-auto-compile +-*- scheme -*- +!# + +;;; Lisparuga +;;; Copyright © 2016 David Thompson +;;; +;;; Lisparuga is free software: you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published +;;; by the Free Software Foundation, either version 3 of the License, +;;; or (at your option) any later version. +;;; +;;; Lisparuga is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with Lisparuga. If not, see . + +(use-modules (sly) + (sly audio) + (lisparuga audio) + (lisparuga game) + (lisparuga view)) + +(with-window (make-window #:title "lisparuga" + #:resolution scaled-resolution) + (enable-fonts) + (enable-audio) + (add-signal-hook! music loop-music) + (add-signal-hook! sound-effects play-sound-effects) + (add-hook! key-press-hook (lambda (key) + (when (eq? key 'escape) + (stop-game-loop)))) + + (add-hook! window-close-hook stop-game-loop) + (start-sly-repl) + (run-game-loop scene)) + +;;; Local Variables: +;;; compile-command: "../pre-inst-env lisparuga" +;;; End: -- cgit v1.2.3