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

  • Finally managed to do something that works and it is now usable with coordinates.

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.5.2.tar.gz (5.5 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.5.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

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

Hashes for cliengine-0.0.5.2.tar.gz
Algorithm Hash digest
SHA256 91904150819ae24ac5ffcbf6d6aff39e5a2e9c565c92cfb1e20ed9c94fda76f3
MD5 8f69d4971e5bb16bde987d558868f78d
BLAKE2b-256 58f69fd66d3d3201103ebfa7bfef6e083925567ddeb97c28fe968c33eea26212

See more details on using hashes here.

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

Hashes for cliengine-0.0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1e82f8deb062b0a25eeb4e272daf533ede39b2cb642e74aa208dfd8fc71833cb
MD5 13cb0d82c93a66dd8916b452d33aaedb
BLAKE2b-256 f72fe9b9d0b06136ef263cba96802da885001658ef20b3a694a53e05b9e95dda

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