A simple and limited game engine for the command-line interface.
Project description
CLI-Engine
A very simple game engine designed to run in the terminal. It works using tables.
Example Usage
import cliEngine
# Initialize the game with a 9x9 board
game = cliEngine.Game(9, 9) # Width and Height.
game.printBoard() # Prints the board.
As I am still writing the docs, here is a full game with movement.
import cliEngine # change this in readme.md
import os
game = cliEngine.Game(9, 9)
player = cliEngine.Player(game, "1", 5, 5) # game class, player sprite, and pos x and y
borderCoordinates = [(0, 0), (1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (6, 0), (7, 0), (8, 0), (0, 1), (8, 1), (0, 2), (8, 2), (0, 3), (8, 3), (0, 4), (8, 4), (0, 5), (8, 5), (0, 6), (8, 6), (0, 7), (8, 7), (0, 8), (1, 8), (2, 8), (3, 8), (4, 8), (5, 8), (6, 8), (7, 8), (8, 8)]
# very long useless line for the coordinates, sadly it is how it is
def gameLoop():
os.system("clear") # UNIX SYSTEMS ONLY COMMAND
game.drawBorders(borderCoordinates, "2")
player.draw()
game.printBoard()
userInput = cliEngine.getInput()
if player.detectCollision("2", userInput):
pass
else:
player.move(userInput)
if __name__ == "__main__":
while True:
gameLoop()
Changelog 0.0.5.1
- As it is broken and I don't wanna keep increasing the number, there is now a new number :D
- Tried fixing it, again.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cliengine-0.0.5.1.tar.gz
(5.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cliengine-0.0.5.1.tar.gz.
File metadata
- Download URL: cliengine-0.0.5.1.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cb871c48486f51ba77aa55368c98855b267c467b3d935e2d6e2a5a2ecc3dcb6
|
|
| MD5 |
4b65921e91e9029c8d0860e7be0e57e5
|
|
| BLAKE2b-256 |
69447ae1a2947901540fa696f04d4e8cfe583541d32d96f200b2769d178ab4f3
|
File details
Details for the file cliengine-0.0.5.1-py3-none-any.whl.
File metadata
- Download URL: cliengine-0.0.5.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79a111899c2e3a465afbbe218db0831302d8fe8e3effca8386f4664bc1c7545c
|
|
| MD5 |
657c45e3cd32e83b32e1684405aa425d
|
|
| BLAKE2b-256 |
feb76e1cc4da47e7fec0dfc511f3ba602b12be894b12c2ba30161d493ec740bf
|