]> git.gir.st - VIper.git/summary
 
descriptionterminal + emoji = snek
last changeSat, 2 Feb 2019 16:49:43 +0000 (17:49 +0100)
readme

VIper - a Snake Clone for Unicode-compatible Terminals

terminal + emoji = snek
🖳 + 💩 = 🐍

Requirements

You'll need a terminal emulator with good Unicode (Emoji) support and compatible fonts to fully enjoy the graphics of this game. This is what I'd recommend:

Keybindings

h, j, k, l or cursor keys move the snake. r to restart, p to pause, q to quit.

TODO

Notes

Why this program is using SIGALRM instead of multithreading

One of the main reasons for making this game was to try some unconventional programming ideas I had. Seeing how far I can get with only a single thread was one of them. Some others were pure lazyness, though.

terminal compat

to display emojis, we need a terminal that can handle a color emoji font (no shit, sherlock). mlterm, xterm and urxvt didn't work in my tests (mlterm might work if compiled correctly, the other two use bitmap fonts and i don't think there are any w/ emoji support). i intend to put bonus items in the game that will only be visible for a short time. when they get near the end of their life, SGI-5 (blink) will make them blink. this is supported in gnome-term 3.28 (vte 0.52) which is supplied with fedora 28. bug report for KDE's konsole you'll need this fontconfig and follow the steps inside.

strange behaviour of SIGALRM

I'm using SIGALRM to advance the snake's position. during some refactoring I noticed that when the signal handler returns, a STX (ASCII 0x02) byte gets pushed onto stdin.

DejaVu Sans Mono: Braille Characters

This font (while otherwise beautiful) does not by default include glyphs for the braille characters in Unicode. And gnome-terminal falls back to some very ugly rendition.

Ubuntu patches this font to include those glyphs, so you can just fetch it from there, or patch the font yourself. For this, open /usr/share/fonts/dejavu/DejaVuSansMono.ttf and DejaVuSans.ttf and copy the braille section to the Mono variant. You can save the font under a different name in the same directory and the fallback will then work correctly.

shortlog
2019-02-02 girstrename to 'viper', new makefile master github/master
2019-01-26 girstimplement SIGTSTP handling
2019-01-05 girstfix raw mode bug
2018-11-05 girstuse correct longjmp buffer
2018-11-05 girstminor cleanup
2018-09-03 girstincrease freeze steps, remove debug/test code
2018-09-03 girsttime freeze bonus
2018-09-03 girstmore food items
2018-09-03 girstremove vt220 support, II
2018-09-03 girstremove vt220 support
2018-09-03 girstreadme: formatting
2018-09-03 girstreadme: new todo
2018-09-03 girstcleanup wrapmode, fix bonus interval
2018-09-03 girstlonghelp: add -l
2018-09-03 girstwrap-around-mode (needs cleanup)
2018-08-31 girstrefactor pause screen; todos, readme updated
...
heads
5 years ago master
Imprint / Impressum