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
- So umm, I broke the entire code so I reestructured it with DeepSeek.
- I hope everything works, so I finally added something to init.py
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.tar.gz
(2.7 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.tar.gz.
File metadata
- Download URL: cliengine-0.0.5.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ecd0b2809cdac9360a80f1c643db1ffc74a8d1e05644f2f3e6590c99bc1282ef
|
|
| MD5 |
eadf4256033c409aed62b16ee4e83441
|
|
| BLAKE2b-256 |
ca01acaddc2b4df57728116d569297c54c2639e8c22f14c2acb4610d82645d5b
|
File details
Details for the file cliengine-0.0.5-py3-none-any.whl.
File metadata
- Download URL: cliengine-0.0.5-py3-none-any.whl
- Upload date:
- Size: 2.7 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 |
50a95d0619c750ccdf66be297d30613baf01b5687ad00bd6ef4a08eecaeb4788
|
|
| MD5 |
6bbb235e121ff19612bed63b6f10f002
|
|
| BLAKE2b-256 |
100568fc85d2b02ea88f5bcbe4c28be054027724ba63f1d6ea8571b7cbd695eb
|