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 test 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.3

  • Last minor update. Made the coordinates app now launch like:
from cliEngine import coordinates
coordinates.launch()
  • Fixed that init.py version variable wasn't up-to-date.

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.3.tar.gz (5.6 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.3-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cliengine-0.0.5.3.tar.gz
  • Upload date:
  • Size: 5.6 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.3.tar.gz
Algorithm Hash digest
SHA256 bebbeffb2f1cb5e3352a87c94781e9633f0b6d42627c65893c98070e70f99260
MD5 d1be2ab93c9bc161f459e77cab59fd3a
BLAKE2b-256 a719de1460fd02b6aff2d3a636972f9de2423961421bfdcd99b04734198e4585

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cliengine-0.0.5.3-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

Hashes for cliengine-0.0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 48b393e7c7687868de304d82279d796615b8866c724e597e3c1eb0ced43fe630
MD5 de8b2d8f1cb39865bdb05eea8d3de78c
BLAKE2b-256 287e6425029922786024d085f7e387dc466d454c4758cf3fdbb125f83640018d

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