Module
This commit is contained in:
parent
80e790d631
commit
3dc062cc23
108
.gitignore
vendored
Normal file
108
.gitignore
vendored
Normal 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
|
62
README.md
62
README.md
@ -1,60 +1,24 @@
|
|||||||
# Terminis
|
# 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
|
```bash
|
||||||
┌────────────HOLD───────────┐┌────────────────────┐┌────────────NEXT───────────┐
|
pip install --user terminis
|
||||||
│ ││██ ││ │
|
|
||||||
│ ██ ││██ ││ ██ │
|
|
||||||
│ ██████ ││██ ││ ██████ │
|
|
||||||
│ ││██ ││ │
|
|
||||||
└───────────────────────────┘│ ██ │└───────────────────────────┘
|
|
||||||
┌────────────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 │
|
|
||||||
│ ││ ██████████████████││ │
|
|
||||||
│ ││ ██████████████████││ │
|
|
||||||
│ ││ ██████████████████││ │
|
|
||||||
│ ││ ██████████████████││ │
|
|
||||||
└───────────────────────────┘└────────────────────┘└───────────────────────────┘
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
```bash
|
```bash
|
||||||
python terminis.py [level]
|
terminis [level]
|
||||||
```
|
```
|
||||||
level: integer between 1 and 15
|
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
|
## Controls edit
|
||||||
Edit values of dictionary CONTROLS in the script:
|
|
||||||
```python
|
You can change keys by editing:
|
||||||
CONTROLS = {
|
* `%appdata%\Terminis\config.cfg` on Windows
|
||||||
"MOVE LEFT": "KEY_LEFT",
|
* `~/.local/share/Terminis/config.cfg` on Linux
|
||||||
"MOVE RIGHT": "KEY_RIGHT",
|
|
||||||
"SOFT DROP": "KEY_DOWN",
|
Acceptable values:
|
||||||
"HARD DROP": " ",
|
* printable characters ('q', '*', ' '...)
|
||||||
"ROTATE COUNTER": "KEY_UP",
|
* curses's constants name starting with "KEY_" (see [Python documentation](https://docs.python.org/3/library/curses.html?highlight=curses#constants))
|
||||||
"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))
|
|
29
pyproject.toml
Normal file
29
pyproject.toml
Normal 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
1
terminis/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
__version__ = '0.1.0'
|
7
terminis/__main__.py
Normal file
7
terminis/__main__.py
Normal 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
Loading…
x
Reference in New Issue
Block a user