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.4.tar.gz (4.7 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.4-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cl_games-0.4.tar.gz
  • Upload date:
  • Size: 4.7 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.4.tar.gz
Algorithm Hash digest
SHA256 c8dee2013c565bae14cc5a05a433e5fa96e6282b69b01e3ad8481c974523d91e
MD5 70dd6827a2aabd5d56d8a9004c6daae2
BLAKE2b-256 43277b8a3e017096d01a3538ac8709bd5df3ebc243ef4b499a5a01927254a1ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_games-0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.3 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4562f4888b550542bd5a4a05cbe7722b18cd5e840968e61cb72cef0dac3949cd
MD5 2f89756ca49feab1b907061794d6390f
BLAKE2b-256 3117f3a24f90dd2e6ab0fc60456fcb6c97c3fbdddfb037ec68d6cd9fc90e968d

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