Skip to content

The Chrome Dinosaur Game from offline mode built using Python and PyGame.

License

Notifications You must be signed in to change notification settings

Scr1pting/Chrome-Dino-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chrome Dino Game

GIF Showing Gameplay

The project is an implementation of the popular Chrome Dino Game using Python and Pygame. The game is shown when a user is offline and when opening chrome://dino.

Use the space bar or arrow up key to jump and the arrow down key to duck.

Differences to other Implementations

This project is based on the implementation by dhhrev. However, this project includes major improvements:

  • Pixel-accurate collision detection; previously the game only checked whether the images overlapped even though they contained a lot of white space
  • Simplified code structure
  • A more appealing menu and better display of the score
  • Clouds in the background
  • Smoother animations, including 60 fps instead of 30
  • More than one obstacle per frame

Extensibility

This project is easy to extend because of its simple file structure. It is therefore especially well-suited for machine learning applications.

To do that, create a new folder in src that includes a custom implementation of chromedino.py. Since the other game elements are each contained in their own files, they can easily be imported. Then, update the main.py file to start your extension.

A sample machine learning implementation is available at Scr1pting/Chrome-Dino-AI. It uses a neural network that is updated by an evolutionary algorithm to master the game.

Run

Run python3 src/main.py to play the game. Make sure to have Pygame installed!

About

The Chrome Dinosaur Game from offline mode built using Python and PyGame.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages