]> git.gir.st - VIper.git/blob - README.md
rename to 'viper', new makefile
[VIper.git] / README.md
1 # VIper - a Snake Clone for Unicode-compatible Terminals
2
3 terminal + emoji = snek
4 🖳 + 💩 = 🐍
5
6 ## Requirements
7
8 You'll need a terminal emulator with good Unicode (Emoji) support and compatible
9 fonts to fully enjoy the graphics of this game. This is what I'd recommend:
10
11 - A VTE based terminal (like GNOME Terminal and a whole bunch of others)
12 - Google Noto's Color Emoji Font (Fedora: `google-noto-emoji-color-fonts.noarch`)
13 - DejaVu Sans Mono with Braille characters patched in (fetch from Ubuntu)
14
15 ## Keybindings
16
17 `h`, `j`, `k`, `l` or cursor keys move the snake.
18 `r` to restart, `p` to pause, `q` to quit.
19
20 ## TODO
21
22 <!--
23 - DONE ~~base game: fixed field size, fixed speed~~
24 - DONE ~~food (unicode)~~
25 - DONE ~~put 'sprites' into `schemes.h`~~
26 - DONE ~~snake elongates~~
27 - DONE ~~unicode chars~~
28 - DONE ~~input buffer (so fast 180° turns get executed)~~
29 - DONE ~~only redraw changing parts of the screen~~
30 - DONE ~~input out of whack when stopping (^Z) and resuming~~
31 - DONE ~~keybindings for restart, pause, redraw~~
32 - DONE ~~on dying: show end screen, allow restarting~~
33 - DONE ~~score, increasing speed~~
34 - DONE ~~bonus/special items: slower snake, shorter snake, etc.~~
35 - DONE ~~wall-wrap-around mode?~~
36 - NAH: predatory animals trying to eat the snake? (🐉, 🐊, 🐆, 🐅, 🦁, 🐗, 🦊, 🦅)
37 -->
38 - TODO even more food items (to shape points distribution), boni
39 - TODO decaying points? (more points the faster you get the food)
40 - TODO fix all `grep -n 'TODO\|XXX\|\([^:]\|^\)//' *.[ch]`
41 - TODO: find a better name
42
43 ## Notes
44
45 ### Why this program is using SIGALRM instead of multithreading
46
47 One of the main reasons for making this game was to try some unconventional
48 programming ideas I had. Seeing how far I can get with only a single thread was
49 one of them. Some others were pure lazyness, though.
50
51 ### terminal compat
52
53 to display emojis, we need a terminal that can handle a color emoji font (no
54 shit, sherlock). mlterm, xterm and urxvt didn't work in my tests (mlterm might
55 work if compiled correctly, the other two use bitmap fonts and i don't think
56 there are any w/ emoji support).
57 i intend to put bonus items in the game that will only be visible for a short
58 time. when they get near the end of their life, SGI-5 (blink) will make them
59 blink. this is supported in gnome-term 3.28 (vte 0.52) which is supplied with
60 fedora 28. [bug report](https://bugzilla.gnome.org/show_bug.cgi?id=579964)
61 for KDE's konsole you'll need [this
62 fontconfig](https://gist.github.com/IgnoredAmbience/7c99b6cf9a8b73c9312a71d1209d9bbb)
63 and follow the steps inside.
64
65 ### strange behaviour of SIGALRM
66
67 I'm using SIGALRM to advance the snake's position. during some refactoring I
68 noticed that when the signal handler returns, a STX (ASCII 0x02) byte gets
69 pushed onto stdin.
70
71 ### DejaVu Sans Mono: Braille Characters
72
73 This font (while otherwise beautiful) does not by default include glyphs for the
74 braille characters in Unicode. And gnome-terminal falls back to some very ugly
75 rendition.
76
77 Ubuntu patches this font to include those glyphs, so you can just fetch it from
78 there, or patch the font yourself. For this, open
79 `/usr/share/fonts/dejavu/DejaVuSansMono.ttf` and `DejaVuSans.ttf` and copy the
80 braille section to the Mono variant. You can save the font under a different
81 name in the same directory and the fallback will then work correctly.
Imprint / Impressum