]> git.gir.st - VIper.git/log
VIper.git
5 years agoBonus items: shorten/elongate snake, speed up/down
girst [Thu, 24 May 2018 20:41:31 +0000 (22:41 +0200)]
Bonus items: shorten/elongate snake, speed up/down

5 years agoBONUS item: snip (Proof of Concept stage)
girst [Thu, 24 May 2018 14:57:58 +0000 (16:57 +0200)]
BONUS item: snip (Proof of Concept stage)

5 years agoclear keyboard buffer on game over
girst [Thu, 24 May 2018 14:25:49 +0000 (16:25 +0200)]
clear keyboard buffer on game over

to test: start with -l50, then stairstep into yourself. on restart,
snake must not continue stairstepping.

5 years agospeed up every 100 points
girst [Thu, 24 May 2018 10:26:05 +0000 (12:26 +0200)]
speed up every 100 points

5 years agoappend_snake(-1,-1) redraw fix
girst [Thu, 24 May 2018 10:13:34 +0000 (12:13 +0200)]
append_snake(-1,-1) redraw fix

5 years ago`-l`: set initial snake length; better init_snake meandering
girst [Thu, 24 May 2018 09:59:12 +0000 (11:59 +0200)]
`-l`: set initial snake length; better init_snake meandering

5 years agoend game when no more free spaces to go
girst [Thu, 24 May 2018 08:58:50 +0000 (10:58 +0200)]
end game when no more free spaces to go

also: end screen message configurable

5 years agos/op.scheme/op.sch/g
girst [Tue, 22 May 2018 13:19:09 +0000 (15:19 +0200)]
s/op.scheme/op.sch/g

5 years agonice end screen
girst [Tue, 22 May 2018 13:08:40 +0000 (15:08 +0200)]
nice end screen

5 years ago^Z bug: proper fix
girst [Tue, 22 May 2018 12:46:28 +0000 (14:46 +0200)]
^Z bug: proper fix

the shell unsets raw_mode, so we need to set it again and also redraw
the field.

5 years agogame loop (restartable), fix memory leak
girst [Tue, 22 May 2018 12:41:09 +0000 (14:41 +0200)]
game loop (restartable), fix memory leak

if we set respawn, we need to break out of the loop, otherwise `i' gets
->next'ed until i == NULL. then, spawn_item() will malloc() a new item,
and `i' was not freed(), but just NULL'd.

5 years agoREADME: konsole setup
girst [Tue, 22 May 2018 09:38:24 +0000 (11:38 +0200)]
README: konsole setup

5 years agofix -d maxwidth
girst [Sun, 20 May 2018 20:13:58 +0000 (22:13 +0200)]
fix -d maxwidth

5 years agofix food-appears-in-heads-old-location bug
girst [Sun, 20 May 2018 18:07:53 +0000 (20:07 +0200)]
fix food-appears-in-heads-old-location bug

5 years agoproof of concept for ^Z bug
girst [Sun, 20 May 2018 17:00:39 +0000 (19:00 +0200)]
proof of concept for ^Z bug

5 years agoREADME: update TODOs
girst [Sun, 20 May 2018 17:00:28 +0000 (19:00 +0200)]
README: update TODOs

5 years agofix width-off-by-one-column bug
girst [Sun, 20 May 2018 08:09:33 +0000 (10:09 +0200)]
fix width-off-by-one-column bug

5 years agosimplify direction buffer access
girst [Sun, 20 May 2018 07:57:32 +0000 (09:57 +0200)]
simplify direction buffer access

5 years agouse ring buffer for movement, minor cleanup
girst [Sun, 20 May 2018 07:31:50 +0000 (09:31 +0200)]
use ring buffer for movement, minor cleanup

(saves on malloc() for every keypress)

5 years agodon't truncate snake on small fields, fix unpause graphics glitch
girst [Sun, 20 May 2018 06:23:55 +0000 (08:23 +0200)]
don't truncate snake on small fields, fix unpause graphics glitch

5 years agoWIP: only redraw changed bits
girst [Sat, 19 May 2018 23:53:10 +0000 (01:53 +0200)]
WIP: only redraw changed bits

5 years agoreuse memory when consuming and re-spawning item
girst [Sat, 19 May 2018 23:35:39 +0000 (01:35 +0200)]
reuse memory when consuming and re-spawning item

5 years agominor in-code cleanup, documentation
girst [Sat, 19 May 2018 23:18:42 +0000 (01:18 +0200)]
minor in-code cleanup, documentation

i wanted to remove the 'only draw diff'-todo and looked into where i was
calling show_playfield(). i didn't call it anywhere where i expected it,
so i fired up gdb. gdb told me show_playfield() gets called from the
input loop after the switch(getchar()). i was puzzled about that,
because it fired even when no keys were pressed. then i noticed that
everytime the signal handler fires, a STX (ASCII 0x02) gets pushed onto
stdin.  WHO FIGURES?!  i was unable to find anything in the
documentation of sigaction or on the internet that indicates this!

5 years agosimple pause mode
girst [Sat, 19 May 2018 21:57:45 +0000 (23:57 +0200)]
simple pause mode

`p' to pause; then `q' to exit, any other key to unpause

5 years agodec charset, print cleanup, command line args, ...
girst [Sat, 19 May 2018 07:30:05 +0000 (09:30 +0200)]
dec charset, print cleanup, command line args, ...

5 years agofix segfault when eating food
girst [Sat, 19 May 2018 06:13:21 +0000 (08:13 +0200)]
fix segfault when eating food

5 years agofound segfault (yay! :/ )
girst [Sat, 19 May 2018 03:10:24 +0000 (05:10 +0200)]
found segfault (yay! :/ )

5 years agolongjmp proof-of-concept; set name for velocity
girst [Sat, 19 May 2018 02:59:06 +0000 (04:59 +0200)]
longjmp proof-of-concept; set name for velocity

(also delete some emojis that are not dispayed in cjk-fullwidth)

5 years agoeven worse coloring hack
girst [Fri, 18 May 2018 23:54:44 +0000 (01:54 +0200)]
even worse coloring hack

5 years agoupdate readme TODOs
girst [Fri, 18 May 2018 23:40:18 +0000 (01:40 +0200)]
update readme TODOs

5 years agolinked list code cleanup
girst [Fri, 18 May 2018 23:30:37 +0000 (01:30 +0200)]
linked list code cleanup

5 years agoclean up append_movement to not add same direction twice
girst [Fri, 18 May 2018 22:47:39 +0000 (00:47 +0200)]
clean up append_movement to not add same direction twice

5 years agoemoji list
girst [Fri, 18 May 2018 21:39:27 +0000 (23:39 +0200)]
emoji list

5 years agofix fast 180° turns (queue all directional keystrokes)
girst [Fri, 18 May 2018 21:30:32 +0000 (23:30 +0200)]
fix fast 180° turns (queue all directional keystrokes)

5 years agogreen snek (dirty (temporary) hack)
girst [Fri, 18 May 2018 00:15:00 +0000 (02:15 +0200)]
green snek (dirty (temporary) hack)

5 years agoexperiment with snake speeds (very ugly)
girst [Fri, 18 May 2018 00:07:38 +0000 (02:07 +0200)]
experiment with snake speeds (very ugly)

5 years agodifferent food values
girst [Thu, 17 May 2018 23:27:56 +0000 (01:27 +0200)]
different food values

5 years agomove enums, struct defs, etc into header file
girst [Thu, 17 May 2018 23:08:11 +0000 (01:08 +0200)]
move enums, struct defs, etc into header file

5 years agoschemes into .h
girst [Thu, 17 May 2018 22:36:21 +0000 (00:36 +0200)]
schemes into .h

5 years agoinitial (proof-of-concept-y) code
girst [Thu, 17 May 2018 21:41:04 +0000 (23:41 +0200)]
initial (proof-of-concept-y) code

Imprint / Impressum