News for hackers. Stuff that matters.
Re:Show HN: Terminal Phase – Terminal-based space shooter by paroneayea on Wednesday January 22, 2020 @01:22PM (#22120346)
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/

- 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

- "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/

- (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

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).

Re:Show HN: Terminal Phase – Terminal-based space shooter by caleb-allen on Wednesday January 22, 2020 @06:46PM (#22123309)
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.

Re:Show HN: Terminal Phase – Terminal-based space shooter by paroneayea on Wednesday January 22, 2020 @07:54PM (#22123773)
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. ;)

Re:Show HN: Terminal Phase – Terminal-based space shooter by caleb-allen on Thursday January 23, 2020 @01:33PM (#22130257)
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!

Re:Show HN: Terminal Phase – Terminal-based space shooter by zenojevski on Wednesday January 22, 2020 @03:27PM (#22121645)
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

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...

- 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...

- The deferred frame-buffer drawing mode:

https://github.com/zenoamaro/arkanoid.sh/blob/master/src/gfx...

Hope you enjoy it :)

Re:Show HN: Terminal Phase – Terminal-based space shooter by the_jeremy on Wednesday January 22, 2020 @04:00PM (#22121976)
Runs at ~5 fps on alacritty. I wouldn't have thought it would be so different on alternate terminals.
Re:Show HN: Terminal Phase – Terminal-based space shooter by zenojevski on Wednesday January 22, 2020 @04:11PM (#22122078)
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?

Re:Show HN: Terminal Phase – Terminal-based space shooter by isoprophlex on Wednesday January 22, 2020 @11:21AM (#22118845)
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 ;)
Re:Show HN: Terminal Phase – Terminal-based space shooter by tempodox on Wednesday January 22, 2020 @02:25PM (#22121049)
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 :)
Re:Show HN: Terminal Phase – Terminal-based space shooter by nategri on Wednesday January 22, 2020 @02:34PM (#22121140)
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).
Re:Show HN: Terminal Phase – Terminal-based space shooter by wpietri on Wednesday January 22, 2020 @02:51PM (#22121296)
It reminds me even more of the nearly-as-ancient side scroller Scramble: https://www.youtube.com/watch?v=3Vc-RIkpk40
Re:Show HN: Terminal Phase – Terminal-based space shooter by ashton314 on Thursday January 23, 2020 @12:08AM (#22125013)
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. :)
Re:Show HN: Terminal Phase – Terminal-based space shooter by cbm-vic-20 on Wednesday January 22, 2020 @12:21PM (#22119643)
I'm not sure my terminal (VT420) will be able to keep up with this.
Re:Show HN: Terminal Phase – Terminal-based space shooter by mixmastamyk on Wednesday January 22, 2020 @10:58AM (#22118605)
Neat, would be cool if it could use unicode.
Re:Show HN: Terminal Phase – Terminal-based space shooter by paroneayea on Wednesday January 22, 2020 @01:16PM (#22120290)
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)

Re:Show HN: Terminal Phase – Terminal-based space shooter by mixmastamyk on Wednesday January 22, 2020 @02:34PM (#22121142)
Cool, thanks. Support is pretty great now if you stay within the basic plane and emoji.
Re:Show HN: Terminal Phase – Terminal-based space shooter by RandomGuyDTB on Wednesday January 22, 2020 @11:03AM (#22118668)
Yeah, with an ASCII mode for compatibility.
Re:Show HN: Terminal Phase – Terminal-based space shooter by reaperducer on Wednesday January 22, 2020 @11:30AM (#22118943)
Yeah, because I intent to try this on a TRS-80 tonight.

It would also be interesting to have a PETSCII option.

Re:Show HN: Terminal Phase – Terminal-based space shooter by Diederich on Wednesday January 22, 2020 @12:58PM (#22120109)
> TRS-80

Wow! Which one, if I may ask?

Re:Show HN: Terminal Phase – Terminal-based space shooter by bitwize on Wednesday January 22, 2020 @01:26PM (#22120406)
Written in Racket. Good stuff. I've done demoeffects in the terminal in Gambit.
Re:Show HN: Terminal Phase – Terminal-based space shooter by nessunodoro on Wednesday January 22, 2020 @12:13PM (#22119530)
The credits transferred to terminal at what looks like 1200 baud makes me happy.
Re:Show HN: Terminal Phase – Terminal-based space shooter by EdSharkey on Wednesday January 22, 2020 @03:56PM (#22121937)
Let me charge the beam like in R-Type for more damage!
Re:Show HN: Terminal Phase – Terminal-based space shooter by matthewhartmans on Wednesday January 22, 2020 @02:17PM (#22120970)
Very cool OP! Love it!
Re:Show HN: Terminal Phase – Terminal-based space shooter by slim on Wednesday January 22, 2020 @11:39AM (#22119035)
that map in the gif looks like the first level of r-type
Re:Show HN: Terminal Phase – Terminal-based space shooter by kitd on Wednesday January 22, 2020 @11:07AM (#22118712)
Nice, though slightly disappointed it's not written in bash ;)
Re:Show HN: Terminal Phase – Terminal-based space shooter by zenojevski on Wednesday January 22, 2020 @03:29PM (#22121662)
You might like my Arkanoid Bash clone :)

https://news.ycombinator.com/item?id=22121645

Re:Show HN: Terminal Phase – Terminal-based space shooter by imglorp on Wednesday January 22, 2020 @12:46PM (#22119956)
Or sed or dc. Challenge?
Re:Show HN: Terminal Phase – Terminal-based space shooter by willis936 on Wednesday January 22, 2020 @01:12PM (#22120235)
How about a single regex?
Re:Show HN: Terminal Phase – Terminal-based space shooter by 6510 on Thursday January 23, 2020 @01:13AM (#22125267)
needs weapon upgrades
Re:Show HN: Terminal Phase – Terminal-based space shooter by austinshea on Thursday January 23, 2020 @12:33PM (#22129608)
gradius