Skip to main content

Board Game Builder

Project description

BoardGameBuilder

!!! Project now in very early stage. Dont use it in any apps :)

Release and upload to pypi Deploy static content to Pages

Object-oriented framework for build board game logic in python

pip install bgameb

Short example

import bgameb

# create the game
game = bgameb.Game('one_board_game')

# add dice and coin types to game
six = bgameb.Dice('six', sides=6)
twenty = bgameb.Dice('twenty', sides=20)
coin = bgameb.Dice('coin') # 2 is default number of sides

# add shaker and add count of stuff to shaker
game.add(bgameb.Shaker('red_shaker'))
for stuff in [six, twenty, coin]:
    game.red_shaker.add(stuff)
    # change coont of dices in shaker
    game.red_shaker[stuff.name].count = 50

# roll all stuff and get result
result = game.red_shaker.roll()

# you can use dict notation offcourse
result = game['red_shaker']['coin'].roll()

# delete components from any collections
del game.red_shaker.six
del game.red_shaker

# define a cards and decks
game.add(bgameb.Deck('cards_deck'))
game.cards_deck.add(bgameb.Card('one_card', count=100))

# deal card from deck. current deck is a python deque
current = game.cards_deck.deal()

# lets create game turn structure and start turn
game.add(bgameb.Steps('game_steps'))
game.game_steps.add(bgameb.Step('phase_one', priority=0))
game.game_steps.add(bgameb.Step('phase_two', priority=1))
current_game_steps = game.game_steps.deal()

# game_steps is a priority queue, that linked to priority attribute
current_step = current_game_steps.get()

Documentation

Development

how install project for development.

Available cli

make proj-doc

make test

make test-pypi to test deploy to testpypi

make log - insert fragmet name to store new about project

make ipython run interactive terminal

make check check flake8 and mypy

Available fragmet naming:

  • .feature: Signifying a new feature.
  • .bugfix: Signifying a bug fix.
  • .doc: Signifying a documentation improvement.
  • .removal: Signifying a deprecation or removal of public API.
  • .misc: A ticket has been closed, but it is not of interest to users.

make release - to bump version and build changelog. You can use towncrier build --draft to check changelog output

* for version management are used incremental and towncrier for changelog

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

bgameb-0.0.26.tar.gz (13.5 kB view hashes)

Uploaded Source

Built Distribution

bgameb-0.0.26-py3-none-any.whl (13.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page