Hacker News new | past | comments | ask | show | jobs | submit login

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




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


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?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: