This commit is contained in:
adrienmalin 2019-02-10 17:23:40 +01:00
parent 80e790d631
commit 3dc062cc23
6 changed files with 877 additions and 739 deletions

108
.gitignore vendored Normal file
View File

@ -0,0 +1,108 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
dist/
develop-eggs/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
target/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
# poetry
poetry.lock

View File

@ -1,60 +1,24 @@
# Terminis
Another Tetris clone... again... but for terminal. Ideal for servers without GUI!
Tetris clone for terminal. Ideal for servers without GUI!
## Installation
## Screenshot
```bash
┌────────────HOLD───────────┐┌────────────────────┐┌────────────NEXT───────────┐
│ ││██ ││ │
│ ██ ││██ ││ ██ │
│ ██████ ││██ ││ ██████ │
│ ││██ ││ │
└───────────────────────────┘│ ██ │└───────────────────────────┘
┌────────────STATS──────────┐│ ██████ │┌──────────CONTROLS─────────┐
│ ││ ██ ││ │
│ SCORE 1017 ││ ████ ││ LEFT MOVE LEFT │
│ HIGH 1017 ││ ████ ││ RIGHT MOVE RIGHT │
│ TIME 00:01:05 ││ ██████ ││ DOWN SOFT DROP │
│ LEVEL 1 ││ ████████ ││ SPACE HARD DROP │
│ GOAL 2 ││ ████ ████████████││ UP ROTATE COUNTER │
│ LINES 2 ││ ██████████████████││ * ROTATE CLOCKWISE │
│ ││ ██████████████████││ H HOLD │
│ ││ ██████████████████││ P PAUSE │
│ ││ ██████████████████││ Q QUIT │
│ ││ ██████████████████││ │
│ ││ ██████████████████││ │
│ ││ ██████████████████││ │
│ ││ ██████████████████││ │
└───────────────────────────┘└────────────────────┘└───────────────────────────┘
pip install --user terminis
```
## Usage
```bash
python terminis.py [level]
terminis [level]
```
level: integer between 1 and 15
## Dependency
* Python
* Python module curses (native on linux)
Can be installed on windows with:
```batch
pip install --user windows-curses
```
## Controls edit
Edit values of dictionary CONTROLS in the script:
```python
CONTROLS = {
"MOVE LEFT": "KEY_LEFT",
"MOVE RIGHT": "KEY_RIGHT",
"SOFT DROP": "KEY_DOWN",
"HARD DROP": " ",
"ROTATE COUNTER": "KEY_UP",
"ROTATE CLOCKWISE": "*",
"HOLD": "h",
"PAUSE": "p",
"QUIT": "q"
}
```
Acceptable values are printable characters ('q', 'w'...) and curses's constants name starting with "KEY_" (see [Python documentation](https://docs.python.org/3/library/curses.html?highlight=curses#constants))
You can change keys by editing:
* `%appdata%\Terminis\config.cfg` on Windows
* `~/.local/share/Terminis/config.cfg` on Linux
Acceptable values:
* printable characters ('q', '*', ' '...)
* curses's constants name starting with "KEY_" (see [Python documentation](https://docs.python.org/3/library/curses.html?highlight=curses#constants))

29
pyproject.toml Normal file
View File

@ -0,0 +1,29 @@
[tool.poetry]
name = "terminis"
version = "0.1.7"
description = "Tetris clone for terminal. Ideal for servers without GUI!"
authors = ["adrienmalin <41926238+adrienmalin@users.noreply.github.com>"]
license = "MIT"
repository = "https://github.com/adrienmalin/Terminis"
keywords = ["Tetris", "terminal", "curses"]
classifiers = [
"Environment :: Console :: Curses",
"Programming Language :: Python",
"Topic :: Games/Entertainment :: Puzzle Games",
"Topic :: Games/Entertainment :: Arcade",
"Operating System :: OS Independent",
"Topic :: Terminals",
"Topic :: System :: Systems Administration"
]
readme = "README.md"
[tool.poetry.dependencies]
python = ">2.6"
windows-curses = {version = "^1.0", platform = "win32"}
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
[tool.poetry.scripts]
terminis = 'terminis.terminis:main'

1
terminis/__init__.py Normal file
View File

@ -0,0 +1 @@
__version__ = '0.1.0'

7
terminis/__main__.py Normal file
View File

@ -0,0 +1,7 @@
# -*- coding: utf-8 -*-
from . import terminis
if __name__ == "__main__":
terminis.main()

File diff suppressed because it is too large Load Diff