Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Make a browser game in Scheme with Hoot

A topic by David Thompson created 95 days ago Views: 350 Replies: 8
Viewing posts 1 to 5
Jam Host(+3)

If you are interested in making a web browser game with Scheme then Hoot is a great option for you! Hoot is a Scheme to WebAssembly compiler that supportsR7RS-small and a subset of Guile such as delimited continuations (useful for scripting games via coroutines). The  Hoot game jam template repository on Codeberg has everything you need to get started.

The template repository includes:

  • Bindings to the necessary web APIs to make an interactive game with HTML5 canvas
  • A Makefile for compiling, running a development web server, and generating a .zip bundle for uploading to itch.io
  • A very simple Breakout-like example game that demonstrates how to put all the pieces together

Some games made with Hoot for past jams:

I'll do my best to help anyone that uses Hoot for the jam, whether here in this forum, on the official Spritely forum, or on the #spritely channel on the Libera.Chat IRC network. Have fun!  馃

Jam Host(+1)

Yesterday, we released Hoot 0.9.0 and updated the template repo accordingly. Also, a new contributor added basic gamepad support so there's now a starting point for more than just keyboard input.

One day until the jam! Have fun everyone!

Submitted

I have some hoot related questions:

Is it possible to load multiple wasm modules in the game.js file? It would be helpful for reducing the compile times (and maybe used for hot reloading if possible, reloading the hoot module from javascript). I could not figure out how to use  load_extension.

I also tried the repl (works great with the geiser hoot extension for Emacs)  but, since it can't reload functions, I did not figure out how to use it effectively, could you share some tips?

Jam Host

Yes, it is possible to load multiple wasm modules but there are some caveats that make it an advanced topic. I have done this before, though. One issue is that record type descriptors are not canonicalized between wasm modules, so if you had record type <foo> in modules A and B they would be completely different types.

Whole program compilation is just kind of a slow thing in general. We are trying to make compilation less frequent during development by improving the tools for live hacking. We're not there yet, of course, but it's getting better.

I don't understand what you mean by "it can't reload functions"?

Submitted

Sorry, I meant re-evaluating a function (with geiser send definition). What worked for me was exporting a global variable (a record)  from a module, and then in the REPL changing the value of different fields, it worked well with the game loop. But it is cumbersome to use globals in this way, I only did it to try out  the REPL and the geiser hoot package. I know there are limitations with the current version of the REPL, that is why I'm asking for some useful tips given said limitations (I only tried it briefly, global variables was the only thing that came to mind).

Jam Host

It is possible to re-define top-level symbols with the REPL currently. I haven't had the opportunity to try live coding a game but replacing top-level definitions is something I did a lot when developing geiser-hoot.

Submitted

Thank you. I tried the REPL again, and after importing a module,  functions can be redefined. What I was trying to do was fetching the function name and redefine it (using set!)  in what I had assumed was the main process, I understand know that run-web-repl starts the REPL from scratch (with very little context from where it is launched). I will try to start the game loop from within the REPL and see how it goes. 

Submitted

A takeaway from this jam: most games written with Hoot worked really well and were convenient to use. The few exceptions were due to input handling, for example a game written for a gamepad not working at all without one (because no non-gamepad buttons were recognized).

So maybe that鈥檚 an area that could use some polish in defaults (for example by including a default set of keys to start the game with in the template).

Jam Host(+1)

The template includes keyboard controls so the decision to remove them was entirely the choice of the developer.