Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

API library for simulating dice rolls and dice-related operations.

License

NotificationsYou must be signed in to change notification settings

ViciousSquid/diceroll

Repository files navigation

diceroll is a Python library that provides API functionality (dicerollAPI) for simulating dice rolls and performing dice-related operations.

It includes classes for rolling dice, tracking & saving roll results, and animating dice rolls using Pygame (optional)

API documentation starts here:https://github.com/ViciousSquid/diceroll/blob/main/Docs/dicerollAPI.md

Features

  • Roll various types of dice (e.g., 2d6, 1d20, 3d8+1d4) and get the roll results
  • Console printing and logging
  • Save the last 5 roll results to a file (.txt or .json)
  • Retrieve the last 5 roll results
  • Saving throws and skillchecks
  • Set/Get the dice/font color (red, white, blue, black, green, custom)
  • Animations (optional, requires Pygame)

Further Documentation

https://github.com/ViciousSquid/diceroll/tree/main/Docs


Source files:

diceroll.py : Contains theDiceRoller andOutcomeDeterminer classes, as well as theroll_dice function.

diceroll_anim.py :(optional) Contains theDiceAnimator class, which handles animation using the Pygame.

diceroll_api.py : ExposesdicerollAPI classes and defs

diceroll_enums.py

Example.py andExample2.py : Commented demos of theroll_dice function in the console.

Example3_gui.py : A simple demo of an animated roll that returns a result (requires pygame)


This API was custom-designed for use in theAdventure!Interactive story engine :https://github.com/ViciousSquid/Adventure

How to integrate the API into your own projects is demonstrated by the above game engine

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp