game | ||
lib | ||
conf.lua | ||
main.lua | ||
README.md |
snake in love2d
This is my first ever "Real-Coding" project. I was used to script some neat bash-scripts but never have i touched anything proper. YES i love neovim customization as you can see with my neovim configs mini and nvim. And while i did learn much lua with configuring my neovim, i thought it should be time to gather some more knowlage and spread my legs to other topics which i was interested in for a while, but never was brave enough to start a project. Now here we have the love2d snake variant of mine.
Right now, the snake only has a head, which can move up
, down
, left
and
right
with either wasd
or the vim bindings (hjkl
). The score is updated
after you pick up an apple/goodie, and the pickup of the goodie resets the
position of it, so that it's on a different spot every time. The gameboard right
now is 7x7 (9x9 grid with 1 space outside of the gamefield) just for the ease of
use. I'm still planning to implement a neat game mechanic, where the game field
extends if you won a level.
Right now i'm still in the learning process of finding the logic to code some
actions. That's why i have so much Debugging happening. I coded it in, also to
just get to know the language and syntax a bit better. You could in theory turn
this off if you just comment the lines with the Debug.
prefix (Though the
score is also displayed via the Debug.print_score
, so you might not want to
comment IT out..)
How to 'play'
Just clone the repo:
git clone --depth=1 https://git.k4li.de/love2d/snake.git
.. and run with love (11.4+)
cd snake && love .
To install love, you probably just have to do apt-get install love
or pacman -S love
and you should be good to go.