rocket_game
The Rocket game, implemented in Python, inspired by https://github.com/aochagavia/rocket_wasm.
This implements the game logic, but the drawing/rendering is left as an excercise for the reader.
Usage
from rocket_game import RocketGame
game = RocketGame()
# Properties
game.ship # the ship's position (x, y)
game.ship_angle # the ship's angle in radians
game.enemies # the enemy positions (Nx2 array)
game.bullets # the bullet positions
game.particles # the particle positions (Nx3 array, 3d column are the weights)
game.score # the current score
# Methods
# Set the world size, either once or when window resizes (safe to call at each draw)
game.set_world_size(width: float, height: float, scale=1)
# Reset the game (called automatically when dying)
game.reset()
# Let the game progress
game.auto_tick() # recommended
game.tick(time_delta: float) # more control
# Control the ship
game.toggle_boost(boosting: bool)
game.toggle_shoot(shooting: bool)
game.toggle_turn_left(turning_left: bool)
game.toggle_turn_right(turning_right: bool)
game.toggle_all_off()
Example screenshots
Metadata
Release files for rocket_game 26.7.1
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 |
|---|---|---|---|---|
| rocket_game-26.7.1.tar.gz | 2.1 MB | Without provenance | Details for rocket_game-26.7.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rocket_game-26.7.1-py3-none-any.whl | Python 3 | none | any | Details for rocket_game-26.7.1-py3-none-any.whl |
Total release size: 2.1 MB
Release files / rocket_game-26.7.1.tar.gz
| Download URL | rocket_game-26.7.1.tar.gz |
|---|---|
| Size | 2.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7cf00de76c10bff999070ff75a1f14d5b56e49629b988d860d5dfd731765894d
|
|
BLAKE2b-256 checksum How to use checksums |
e2af10ea25eae193f1955be613b33cc76a8e226d44d52b5654b37963b3f4e862
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.34.2
|
Release files / rocket_game-26.7.1-py3-none-any.whl
| Download URL | rocket_game-26.7.1-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b9ae60fc17c5e57f79c8c14363373cb1b82d3c95961b9b471431a35d80fc23ec
|
|
BLAKE2b-256 checksum How to use checksums |
a643b0d2276c39edd787dfe6335babebba261518299386e5041089936bb7ad60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.34.2
|
Security for rocket_game 26.7.1
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.