From 23b75d36fdb6bc00e26428f1b5f2fa20363fcfb6 Mon Sep 17 00:00:00 2001 From: Peter Tillemans Date: Fri, 17 May 2024 23:49:31 +0200 Subject: [PATCH] add dthompson game template --- .gitignore | 19 +++++---- Makefile.am | 29 +++++++++++++ README.md | 54 +++++++++++++++++++++++- assets/images/chickadee.png | Bin 0 -> 755 bytes assets/{ => images}/knight.png | Bin assets/{ => images}/lr_penguin2.png | Bin assets/{ => images}/simples_pimples.png | Bin bootstrap.sh | 3 ++ bundle.scm | 4 ++ configure.ac | 18 ++++++++ game/main.scm | 38 +++++++++++++++++ guix.scm | 29 +++++++++++++ pre-inst-env.in | 10 +++++ scripts/run-game.in | 7 +++ 14 files changed, 200 insertions(+), 11 deletions(-) create mode 100644 Makefile.am create mode 100644 assets/images/chickadee.png rename assets/{ => images}/knight.png (100%) rename assets/{ => images}/lr_penguin2.png (100%) rename assets/{ => images}/simples_pimples.png (100%) create mode 100755 bootstrap.sh create mode 100644 bundle.scm create mode 100644 configure.ac create mode 100644 game/main.scm create mode 100644 guix.scm create mode 100644 pre-inst-env.in create mode 100644 scripts/run-game.in diff --git a/.gitignore b/.gitignore index 5dc83e0..9148070 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,10 @@ -# ---> Scheme -*.ss~ -*.ss#* -.#*.ss - -*.scm~ -*.scm#* -.#*.scm - +*.go +/Makefile +/Makefile.in +/aclocal.m4 +/autom4te.cache/ +/build-aux/ +/config.log +/config.status +/configure +/pre-inst-env diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..024fc0e --- /dev/null +++ b/Makefile.am @@ -0,0 +1,29 @@ +GOBJECTS = $(SOURCES:%.scm=%.go) +nobase_mod_DATA = $(SOURCES) +nobase_go_DATA = $(GOBJECTS) + +# Make sure source files are installed first, so that the mtime of +# installed compiled files is greater than that of installed source +# files. See +# +# for details. +guile_install_go_files = install-nobase_goDATA +$(guile_install_go_files): install-nobase_modDATA + +CLEANFILES = $(GOBJECTS) +GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat +SUFFIXES = .scm .go +.scm.go: + $(AM_V_GEN)$(top_builddir)/pre-inst-env $(GUILE_TOOLS) compile $(GUILE_WARNINGS) -o "$@" "$<" + +moddir=$(prefix)/share/guile/site/$(GUILE_EFFECTIVE_VERSION) +godir=$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache + +SOURCES = \ + game/main.scm + +EXTRA_DIST = \ + $(SOURCES) \ + assets/images/chickadee.png \ + COPYING \ + README.md diff --git a/README.md b/README.md index f44acff..3f0e71c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,53 @@ -# bloatrunner +# Chickadee Game Template -Small loderunner clone for the 2024 game jam \ No newline at end of file +This repository provides a template to use as a starting point for +making a new game using +[Chickadee](https://dthompson.us/projects/chickadee.html)! It +includes all the autotools boilerplate so you don't have to worry +about that nonsense too much. + +## Using Guix + +We *highly recommend* using [Guix](https://guix.gnu.org/) to manage +your development environment. Once Guix is installed, getting all of +the dependencies you need to develop is *easy*. Just run `guix shell` +from the root directory of this repository and you'll be good to go! + +## Building from source + +Assuming Guile and Chickadee are installed on your system, a fresh +project can be built like so: + +``` +./boostrap.sh +./configure +make -j$(nproc) +``` + +After the build system is initialized, only `make` needs to be run to +recompile the Scheme modules. + +## Running the game + +To run the game from the source checkout, use the `pre-inst-env` wrapper script: + +``` +./pre-inst-env run-game +``` + +## REPL-driven development + +After the game is launched, a Guile REPL server will be running on +port 37146. We recommend using the +[Geiser](https://geiser.nongnu.org/) Emacs extension for connecting to +it using `M-x connect-to-guile`. Once Geiser connects to the REPL, +the game can be modified while it runs! + +## Bundling + +If you are setup to produce redistributable bundles of Chickadee games +(see +https://dthompson.us/manuals/chickadee/Invoking-chickadee-bundle.html), +then you can use `chickadee bundle` to produce binary release bundles. +This is admittedly an area where things really do not "just work" as +they should, so do reach out for help if you need it. diff --git a/assets/images/chickadee.png b/assets/images/chickadee.png new file mode 100644 index 0000000000000000000000000000000000000000..17a35e068e06710ae5963ac85506aa1aadfeacbb GIT binary patch literal 755 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPtqc|gj#OE{D3V=egnIRD+&iT2ysd*(pE(3#eQEFmI zYKlU6W=V#EyQgnJie4%^0|QgIr;B4q#jUq@ZL@<)+u` zUwHlX)NT1Y{c$?dZ|vNmq{1r)b)_8Tt#%w{LMH}?yt zUFDw*ugpKZc(Z4Rt(Cr_)q90swoYY!39K8qp<%_+V0oZ4<$u1yr7v?9X6Ao8*LC}T z?w);DQC<0r;eYVu;+8cTe1fvi-H$)Kd0l>PxxiUql$0^TA|+$$(_8Z&96gy<_ /dev/null; pwd`" +abs_top_builddir="`cd "@abs_top_builddir@" > /dev/null; pwd`" + +export GUILE_LOAD_COMPILED_PATH="$abs_top_builddir${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH" +export GUILE_LOAD_PATH="$abs_top_builddir:$abs_top_srcdir${GUILE_LOAD_PATH:+:}:$GUILE_LOAD_PATH" +export PATH="$abs_top_builddir/scripts:$PATH" + +exec "$@" diff --git a/scripts/run-game.in b/scripts/run-game.in new file mode 100644 index 0000000..3a1020d --- /dev/null +++ b/scripts/run-game.in @@ -0,0 +1,7 @@ +#!@GUILE@ \ +--no-auto-compile -e main -s +!# + +(use-modules (game main)) +(define* (main #:optional (args (command-line))) + (launch-game args))