Skip to main content

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.4

  • First try to fix that weird ah error that you have to do 'from src import cliEngine' instead of 'import cliEngine'.
  • Updated the README page with a Changelog and a Game Example.
  • Now bundled with CLI-Engine is now coordinates.py that is launched with getting and launching with one specific file because it is in fact a tkinter app.

Project details


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.4.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cliengine-0.0.4-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file cliengine-0.0.4.tar.gz.

File metadata

  • Download URL: cliengine-0.0.4.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for cliengine-0.0.4.tar.gz
Algorithm Hash digest
SHA256 e7eda395f1f5f5c47523f1f7e33b93649b4a466cb7cd5f13ebe2e171ee94dd0e
MD5 a7d95866cdb6ace357e3bd49a44124f0
BLAKE2b-256 7ee335d2e2e1a93e6c93dcfe8b0ccedeccb8dcb3ece5b7217400d403e9aee047

See more details on using hashes here.

File details

Details for the file cliengine-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: cliengine-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for cliengine-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 edfe4579bbb763bed7e67e13af718dfa7ab51f209fc0bf6af4b9d38c464f6d51
MD5 189a3a600e0cbc85b8a7c1e05d832ebf
BLAKE2b-256 b48db5df462316d9e94236fff00803b251cf64594c49e04a36722cec95f49f2c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page