Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alec-gibson/nvim-tetris
Bringing emacs' greatest feature to neovim - Tetris!
https://github.com/alec-gibson/nvim-tetris
aniseed fennel game lua neovim neovim-plugin tetris
Last synced: about 2 months ago
JSON representation
Bringing emacs' greatest feature to neovim - Tetris!
- Host: GitHub
- URL: https://github.com/alec-gibson/nvim-tetris
- Owner: alec-gibson
- License: gpl-3.0
- Created: 2021-03-13T23:52:56.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-01-17T08:36:31.000Z (11 months ago)
- Last Synced: 2024-07-31T20:51:53.978Z (4 months ago)
- Topics: aniseed, fennel, game, lua, neovim, neovim-plugin, tetris
- Language: Lua
- Homepage:
- Size: 209 KB
- Stars: 194
- Watchers: 1
- Forks: 9
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neovim - alec-gibson/nvim-tetris - Bringing emacs' greatest feature to Neovim - Tetris!. (Game / Tmux)
README
# nvim-tetris
Bringing emacs' greatest feature to neovim - Tetris!![Gameplay Screenshot](./gameplay.png "Some poorly executed demo gameplay")
This plugin is written in [Fennel](https://fennel-lang.org/) using Olical's project [Aniseed](https://github.com/Olical/aniseed) for creating the project structure, and as a library of helper functions and macros. The game compiles to Lua and uses Neovim API functions, so Vim support is not currently a goal.
nvim-tetris is a work-in-progress, and is not feature complete.
## How To Install
- Prerequisites: neovim
- You can install the plugin just like any other Neovim plugin. I personally use [vim-plug](https://github.com/junegunn/vim-plug).
- Another way to install would be to just clone this repo into `~/.local/share/nvim/site/pack/*/start/`, where `*` is whatever you choose (I use "alec").
- After installing, you can launch a game of Tetris using the `:Tetris` command inside Neovim.
- If your colours look weird, ensure you are using a terminal which supports true colour, you have configured tmux for true colour support if you are using tmux, and you have the `termguicolors` option enabled in Neovim.## Controls
- Left Arrow: move left
- Right Arrow: move right
- Up Arrow: rotate piece
- Down Arrow: soft drop
- Space Bar: hard drop## What Works
- Core game functions including controlling the current piece, clearing lines, and gameover when you run out of space
- Piece shadow showing where the current piece will land
- Level progression - you progress a level every 10 lines cleared, and the game gets faster with each level
- Short delays when the piece appears and when it locks. The locking delay resets when rotating or moving your piece, to make gameplay more fun at high speeds
- Correct rotation behaviour including wall-kicks according to "How Guideline SRS Really Works" from https://harddrop.com/wiki/SRS (this means T-spins work)## Next Steps
- Add border showing current level, current score, next piece, saved piece (and add logic for saving pieces)
- Add pause screen (with options to resume game, start new game or quit)
- Add game over screen (with options to play again or quit)
- Add intro screen which shows controls
- Add logic for score
- Configuration
- Documentation
- Tests
- Stretch goals: music, leaderboards?, ...