A Python reimplementation of the famous dino game, thought for autonomous control
Project description
Dino Game
A Python reimplementation of the famous dino game, thought for autonomous control
Installation
You can install it from pypi
pip install dino-game
Usage
Try the game
To try the game without any automation
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
from dinogame import DinoGame
game = DinoGame()
To start the game's loop you can use play
method
game.play()
Callback
The library provide some callback to feedback the game
loop_callback
is called each framegameover_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.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.