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.2
- Finally managed to do something that works and it is now usable with coordinates.
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.2.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.2.tar.gz.
File metadata
- Download URL: cliengine-0.0.5.2.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 |
91904150819ae24ac5ffcbf6d6aff39e5a2e9c565c92cfb1e20ed9c94fda76f3
|
|
| MD5 |
8f69d4971e5bb16bde987d558868f78d
|
|
| BLAKE2b-256 |
58f69fd66d3d3201103ebfa7bfef6e083925567ddeb97c28fe968c33eea26212
|
File details
Details for the file cliengine-0.0.5.2-py3-none-any.whl.
File metadata
- Download URL: cliengine-0.0.5.2-py3-none-any.whl
- Upload date:
- Size: 6.0 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 |
1e82f8deb062b0a25eeb4e272daf533ede39b2cb642e74aa208dfd8fc71833cb
|
|
| MD5 |
13cb0d82c93a66dd8916b452d33aaedb
|
|
| BLAKE2b-256 |
f72fe9b9d0b06136ef263cba96802da885001658ef20b3a694a53e05b9e95dda
|