Skip to main content

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

Project description

Dino Game

PyPI - License PyPI PyPI - Status GitHub last commit gluten free

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 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.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

dino_game-0.2-py3-none-any.whl (30.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page