Skip to main content

A package for creating video games for command line

Project description

cl_games

This package can be used for building basic video games using the command line.

Usage

For creating a game, extend the clase "Game" and use "Game.run"

`import cl_games

class MainGame(cl_games.Game):

"""docstring for MainGame."""

def __init__(self):

    super(MainGame, self).__init__()

    self.title = "My New Game"

def update(self):

    #This is run every frame

game = MainGame()

game.run() ` To add a sprite, extend class sprite

`class Player(cl_games.sprites.Sprite):

def __init__(self, game):

    super(Player, self).__init__(game)

    self.image = [

        "  ^  ",

        " / \ ",

        "/___\\"

    ]

    self.posX, self.posY = 18, 17

    self.setLengthToImage()

def update(self):

    #Also run every frame

game.addSprite(Player(game))

`

To stop the game, just set the running variable to false on game

game.running = false

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

cl_games-0.3.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

cl_games-0.3-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file cl_games-0.3.tar.gz.

File metadata

  • Download URL: cl_games-0.3.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for cl_games-0.3.tar.gz
Algorithm Hash digest
SHA256 e1ca06ca4ef4145a80d84d265794ea23e9858903278ac2885db6c52a5c4dac25
MD5 f848576f6b85c373a8bd82a2e0903ed0
BLAKE2b-256 bcbe08629d2d21458a7f0ecf3e54017a9d980e41ecb80aa528d462a763b2a685

See more details on using hashes here.

File details

Details for the file cl_games-0.3-py3-none-any.whl.

File metadata

  • Download URL: cl_games-0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for cl_games-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d18cae40a8b704c3fbf866dee56a19e22cf68369979cb5010345f9025182981e
MD5 816d2f21b16739e7f819ef4bc112f90d
BLAKE2b-256 1a7dc1ee0be3c12d1a4bf0e37049f9f84eb10e98394e8caea185d968ce26dc70

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