To see a demo of the game start, clone, then run python3 -m GameStarter.gamestart
There are also some test cases that test that the class handles some simple invalid configurations correctly and that it can handle the various imperfections of the humans that want to start a game. Run the tests with python -m GameStarter.gamestart_test
To use this code:
- import it
from GameStarter import GameStarter
- instantiate the
GameStarterclass
gs = GameStarter(total start delay, delay to join game, delay to leave game)
#eg...
gs = GameStarter(5.0, 2.0, 0.5)
- then report whenever a player pushes or releases a button:
gs.player(0).push() #report button push for first player
gs.player(1).release() #report button release for second player
- regularly update the internal timer at the desired resolution:
gs.step_time(0.05) #Step 0.05 seconds, call this every 0.05 seconds (for example)
- then you can see if you have enough players ready like so:
if gs.should_start : #we have enough players to start
- you can determine which players have joined using:
gs.joined_players
Metadata
Release files for game-starter 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| game-starter-2.0.0.tar.gz | 4.7 kB | Without provenance | Details for game-starter-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| game_starter-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for game_starter-2.0.0-py3-none-any.whl |
Total release size: 10.9 kB
Release files / game-starter-2.0.0.tar.gz
| Download URL | game-starter-2.0.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1db195004fb36a96ca223fe74635b28104122ccd831156e3ec266d0db0df09a2
|
|
BLAKE2b-256 checksum How to use checksums |
3fa54598068a86635d854ee1c82ef81ad2a39d3dd037b7de09e3fb76e0be54ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
|
Release files / game_starter-2.0.0-py3-none-any.whl
| Download URL | game_starter-2.0.0-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2680d4bf93bef984c35e8be1b185f6fee435149700677b3622a5e83e8a5f179e
|
|
BLAKE2b-256 checksum How to use checksums |
c08c28e47a9879432caaa85952915dc652af05d1a7dfec536a2da913ff4b9b7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
|
Security for game-starter 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.