Metadata-Version: 2.1
Name: dino-game
Version: 0.2
Summary: A Python reimplementation of the famous dino game, thought for autonomous control
Home-page: https://github.com/RobertoBochet/dino-game
Author: Roberto Bochet
Author-email: robertobochet@gmail.com
License: gpl-3.0
Keywords: game,gym,dino,pygame
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: pygame (>=2.0.0.dev6)
Requires-Dist: numpy

# Dino Game

![PyPI - License](https://img.shields.io/pypi/l/dino-game)
![PyPI](https://img.shields.io/pypi/v/dino-game)
![PyPI - Status](https://img.shields.io/pypi/status/dino-game)
![GitHub last commit](https://img.shields.io/github/last-commit/robertobochet/dino-game)
![gluten free](https://img.shields.io/badge/gluten%20free-100%25-success)

A Python reimplementation of the famous dino game, thought for autonomous control

## Installation

You can install it from pypi

```bash
pip install dino-game
```

## Usage

### Try the game

To try the game without any automation

```bash
python -m dinogame
```

You can use `spacebar` to start running, jump, reset when dino die, and `key_down` to crouch.

### Library usage

This initialize the game

```python
from dinogame import DinoGame

game = DinoGame()
```

To start the game's loop you can use `play` method

```python
game.play()
```

#### Callback

The library provide some callback to feedback the game

- `loop_callback` is called each frame
- `gameover_callback` is called when a gameover occurs

To subscribe to callback you can use callback's `set` method. To the callbacks are given the current instance of `DinoGame` as argument.

```python
def lp_cb(game: GameDino):
    # do something

game.loop_callback.set(lp_cb)
```

## Credits

This project is realized with the following python's packages:

- `pygame`
- `numpy`

