
Show HN: Terminal Phase – Terminal-based space shooter - paroneayea
https://dustycloud.org/blog/terminal-phase-1.0/
======
paroneayea
Oh, nice to see this getting attention on HN!

Author here, happy to answer any questions about how this was made, though
I'll answer a few things up front:

\- It's made in Racket, and as for why there's a whole section about that if
you scroll down on on: [https://dustycloud.org/blog/terminal-phase-
prototype/](https://dustycloud.org/blog/terminal-phase-prototype/)

\- I showed a playthrough (pre-1.0) as well as how to add new levels and
enemies on a live stream I did last week:
[https://www.youtube.com/watch?v=wxt2dqqulQc](https://www.youtube.com/watch?v=wxt2dqqulQc)

\- "Why?" This is actually a test program for some stuff I'm building for the
future of the federated social web (if you are familiar with ActivityPub, I'm
one of the authors of that), an ocap-actor-model-framework called Spritely
Goblins. More on Spritely here:
[http://dustycloud.org/blog/spritely/](http://dustycloud.org/blog/spritely/)

\- (Shameless shill) If you think this is cool, this was actually funded by
people who donate to my Patreon account and was a reward. If you donate, you
can show up in the credits of the game:
[https://www.patreon.com/cwebber](https://www.patreon.com/cwebber)

BTW a newer version of Racket is needed, at least 7.3 (maybe 7.2 is fine). If
you play the game, let me know! I'll be adding more stuff soon, including
powerups, more levels, a boss, and better balance for level 2 (which is
probably a bit too brutal for a second level).

~~~
caleb-allen
Hey Christopher! I really really love this.

We met at Racket con this last year (and grabbed dinner briefly). I love your
passion for open projects and think about that, especially as I make my own
plans!

I especially love your passion for the reality of funding for open projects,
and I'm excited to see what comes of your labors.

~~~
paroneayea
Heya! Nice to re-see you :)

I appreciate that and am thrilled when I hear that enthusiasm rubs off. I
promise all this game stuff amounts to something interesting in relationship
to the federated social web, even if it isn't obvious yet from here. ;)

~~~
caleb-allen
Hey, if there's anything I love more than open software it's open software
that is a game!

I watched the video of the game from the 90s you referenced, I think games are
a fantastic way to explore bigger ideas.

Best of luck!

------
zenojevski
If you like terminal games, you might be interested in my Bash Arkanoid clone!

It's packed with cool text graphics, animations, sound effects, paddle
acceleration, side spin, and power-ups. Clone, inspect, play with Q and P
keys.

[https://github.com/zenoamaro/arkanoid.sh](https://github.com/zenoamaro/arkanoid.sh)

I employed a number of tricks. The ones I am particularly proud of are:

\- The title screen, which uses the iconic old-school wavy text effect. To
make this fast in Bash, I ended up precomputing the table of sin that
determines the offset of each slice:

[https://github.com/zenoamaro/arkanoid.sh/blob/master/src/tit...](https://github.com/zenoamaro/arkanoid.sh/blob/master/src/title.sh)

\- The rendering system required to get all this to run a smooth, consistent
60fps on both linux and macs, without blocking key reading. It sends itself an
ALRM signal trap to run the game loop in a co-process, much similarly to how
it's usually done with `requestAnimationFrame`:

[https://github.com/zenoamaro/arkanoid.sh/blob/master/arkanoi...](https://github.com/zenoamaro/arkanoid.sh/blob/master/arkanoid.sh#L21)

\- The deferred frame-buffer drawing mode:

[https://github.com/zenoamaro/arkanoid.sh/blob/master/src/gfx...](https://github.com/zenoamaro/arkanoid.sh/blob/master/src/gfx.sh#L25)

Hope you enjoy it :)

~~~
the_jeremy
Runs at ~5 fps on alacritty. I wouldn't have thought it would be so different
on alternate terminals.

~~~
zenojevski
Yes, it's impressive how much difference there is. There are ways to improve
each, but this is the best cross-terminal solution I found.

Do you have the same results with your other terminal emulators?

------
isoprophlex
Whoa this looks sweet. I'm looking forward to vicariously installing and
playing this on way too expensive hardware, meant to be used for boring work
things, and paid for by other people than myself ;)

------
tempodox
Wow, this actually looks like Defender, an ancient arcade space shooter. At
the time I found that lethally difficult, never survived even three minutes of
it. Maybe Terminal Phase will grant me some revenge after all this time :)

~~~
nategri
Defender is probably one of the hardest games ever made, if only because of
the wacky controls (a 1D joystick that only moves your ship up and down, and a
_button_ for reversing your direction).

------
ashton314
The first thing I thought when I saw this was “oh nice that looks fun”, but
then I saw it was in Racket and thought “holy cow I have GOT to play that”!
I’m just entering the world of PL, and Racket is a gorgeous language. I love
seeing it used for game development. If you were at RacketConf 2019 I probably
bumped into you. :)

------
cbm-vic-20
I'm not sure my terminal (VT420) will be able to keep up with this.

------
mixmastamyk
Neat, would be cool if it could use unicode.

~~~
paroneayea
Hi! Author here... actually it does use unicode (which we'll use to mean non-
ascii at the moment, even though ascii is part of unicode (pedantry,
pedantry)) for the starfield at the moment, those are braille characters so
that it can have "smoother" and more fine grained movement of the stars. The
frame around the game also uses non-ascii characters. However I'm planning on
adding two modes: one that uses _no_ unicode characters and is pure, and one
that uses more unicode for a larger variance.

I tried being moderately conservative for the moment because I'm not sure
which terminals support what! (Admittedly the recent addition of starfields in
git master stepped away from that a little)

~~~
mixmastamyk
Cool, thanks. Support is pretty great now if you stay within the basic plane
and emoji.

------
bitwize
Written in Racket. Good stuff. I've done demoeffects in the terminal in
Gambit.

------
nessunodoro
The credits transferred to terminal at what looks like 1200 baud makes me
happy.

------
EdSharkey
Let me charge the beam like in R-Type for more damage!

------
matthewhartmans
Very cool OP! Love it!

------
slim
that map in the gif looks like the first level of r-type

------
kitd
Nice, though slightly disappointed it's not written in bash ;)

~~~
imglorp
Or sed or dc. Challenge?

~~~
willis936
How about a single regex?

------
6510
needs weapon upgrades

------
austinshea
gradius

