Metadata-Version: 2.4
Name: rocket_game
Version: 26.7.1
Summary: The Rocket game, implemented in Python
Keywords: canvas,rendering,game,rocket
Author: Almar Klein
Requires-Python: >= 3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Project-URL: Homepage, https://github.com/almarklein/rocket_game_py

# 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

```py
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

<img width='400' src='screenshots/rocket_screenshot1.png' />
<img width='400' src='screenshots/rocket_screenshot2.png' />
<img width='400' src='screenshots/rocket_screenshot3.png' />
