Skip to main content

An object-oriented wrapper for the Python curses library.

Project description

crsgame

An object-oriented wrapper for the Python curses library.

Installation

pip install crsgame

Example

import curses
from crsgame import Renderer, Color, Vector, Box

def main(stdscr):
    r = Renderer(stdscr, fps=15)

    r.RegisterColor("white", Color("white"))

    obj = Box(Vector(5, 5), Vector(2, 2), True, "#", "white")

    def loop(deltaTime):
        r.Render([obj])
    r.RenderStep.Connect(loop)

    r.Run()

curses.wrapper(main)

Features

  • Object-oriented curses API
  • Automatic delta rendering
  • Shapes, colors, input handling
  • Asynchronous game loop support

Objects

  • Renderer(stdscr, bgcolor, fps)

  • Vector(x, y)

  • Color(colorName)

  • Box(position, size, fill?, character, color)

  • Line(pointA, pointB, character, color)

  • Quad(topLeft, topRight, bottomLeft, bottomRight, fill?, character, color)

  • Triangle(pointA, pointB, pointC, fill?, character, color)

  • Text(position, text, color)

  • MouseArea(topLeft, topRight, bottomLeft, bottomRight)

Update Logs (last 3 updates)

0.1.1

  • Updated README.md
  • Added Triangle
  • Added MouseArea

0.1.0

  • Initial release

Links

PyPI: https://pypi.org/project/crsgame

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

crsgame-0.1.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

crsgame-0.1.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file crsgame-0.1.1.tar.gz.

File metadata

  • Download URL: crsgame-0.1.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for crsgame-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ab1dec8402e308c098d4e25a1367e97320ccadd223b7efb5322e485f231eb0a2
MD5 4db33c2b2765d9b97c30912e911893bc
BLAKE2b-256 2f62aa5199b006dd44b450ca517aaa43fd53868d4119607e1457886fcef17d7b

See more details on using hashes here.

File details

Details for the file crsgame-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: crsgame-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for crsgame-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3dc221b5f501d8ec629e1c55b4bf9030bd9c8c3ceec3785e1f7ae1ed68595f59
MD5 dd13e0eb29d764f7cdef765632c8cf94
BLAKE2b-256 080abf119bbb5944b7c8ef2e3abb2aa4d448858013f836f6d6a86fb3e9da71ce

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