
Show HN: R-cade, a simple arcade game engine for Racket - massung
https://github.com/massung/r-cade/
======
ashton314
This looks awesome! I have a brother-in-law who is 15 (gosh he's getting so
old) and who is _frighteningly_ intelligent. He spends most of his free time
hooking up relays to a raspberry pi to control an array of Christmas lights.
I'll forward this repo to him; I've been trying to get him to start
experimenting with Racket. This might just be the ticket.

I think Racket is a wonderful language for education, and this library will
certainly help a lot more kids find interest in learning Racket. When I first
started programming, I wrote a lot of games with ASCII art in Perl. They were
not fast, but I learned a bunch! If I had had this, I would have picked up a
LISP much sooner.

------
danbolt
Is anyone familiar with the stand-alone executable export[1] for Racket?

I did a Ludum Dare and browsed a submission where a child had spent a lot of
time and effort making a project in PyGame, but found it hard to distribute
because he didn’t have the technical know how of converting it to something
like a windows `.exe` file at the time. If this helps youngsters learn and
explore programming the way the Commodore 64 had a nice BASIC->6502 ramp
alongside distribution via floppy/cassette, I’d be super excited about this.

[1] [https://docs.racket-lang.org/raco/exe.html](https://docs.racket-
lang.org/raco/exe.html)

~~~
shakna
raco exe will give you an executable that's dynamically linked, so you also
need to run raco distribute [0] to get a folder full of the libs you'll need
for a "standalone" distribution. (Unless you can depend on Racket being
installed).

I've used the two to make Linux and Windows (via Wine) distributions without
any issues. It's fairly painless.

[0] [https://docs.racket-lang.org/raco/exe-dist.html](https://docs.racket-
lang.org/raco/exe-dist.html)

------
larcrimacida
I am trying to run this and am running into some issues. I'm a newbie so
please help me get going.

First, is this supposed to run from DrRacket? I installed the r-cade
succesfully but when I run this, I get error:

ffi-lib: couldn't open "csfml-audio-2.dll" (The specified module could not be
found.; errid=126)

~~~
massung
You need to download and install the CSFML libraries yourself. For audio you
also need OpenAL and libsndfile. Links to all are in the README.

~~~
larcrimacida
Thanks. I am currently stuck at this step. I did the raco pkg install csfml
and apparently it was installed but i get the same error. Also I tried
downloading the csfml bindings but don't know what to do with it as the
instructions assume prior knowledge or are too cryptic to me. I'm giving up
for now. Maybe I'll try again maybe not.

~~~
larcrimacida
By the way, this hurdles won't help with kids picking this up. Sadly..

------
rcarmo
Very, very nice. I have been pondering getting into pico-8, and this might be
a way to do something similar _and_ have fun with Racket.

------
ddrdrck_
This seems really cool.

The "no external asset" goal reminds me of another very cool game engine,
still actively maintained, but unfortunately totally under the radar : amulet.
There is even an online editor, you can check "defenders of the weeping
quasar" it is quite impressive and totally retro :
[http://www.amulet.xyz/editor.html](http://www.amulet.xyz/editor.html)

------
52-6F-62
For a non-Lisper that code is so clean and readable.

Seems like a fun project to dig into. Busy these days, but might have to give
it a go.

------
TedDoesntTalk
I pasted the 'Hello, World' code after installing dependencies. It worked.
Then I pasted the breakout example at
[https://github.com/massung/r-cade/blob/master/examples/break...](https://github.com/massung/r-cade/blob/master/examples/breakout.rkt)
and ... nothing. Just seems to hang in the terminal without opening an r-cade
window. How can I debug this?

------
actiondoes
I love racket. Does anyone know of a Racket to Javascript compiler. Would love
to be able to create Racket powered web games with this for educational
purposes

~~~
jesseb
I haven't used it (yet) but RacketScript is a thing
[https://github.com/vishesh/racketscript](https://github.com/vishesh/racketscript)

~~~
actiondoes
Thank you! Exactly what I was looking for

------
azhenley
Looks awesome! I’m currently teaching Racket in my undergraduate PL course and
I was just looking for something graphical to show them. I’ll try this in a
week or two!

------
Razengan
What’s the general stance on putting gifs for the Readme into the repository,
potentially bloating its size?

~~~
nxpnsv
In this case I’m all for it. There are 3 gifs, they are not huge while also
clearly shows what the system is capable of. A general stance seems quite
dogmatic, it depends on utility...

------
ArtWomb
Cool! Is there a way to dump the generated sound to wav / mp3 file? And thanks
for building ;)

~~~
massung
Take a look at music.rkt (the very end), there's an example of doing just that
with the Tetris theme song. It's what I would use to test different sound
waves, envelopes, note parsing, etc.

Edit: I was thinking of pulling the RIFF/WAV code out into its own package.
Let me know if this is something you'd find useful.

------
mushufasa
at first i thought it would be a game engine built with R, which would truly
be a crazy hack!

