Bolan.py is a clone of Google Chrome's well-known Dinosaur Game written on Python 3 using the Pygame game development framework.
The player takes control of a T-Rex running across an infinite desert. The main objective is for the player to keep themselves alive as long as possible by pressing the space key to avoid the Cacti and Pterodactyls that come their way. Points are continually scored until the player collides with an obstacle, upon which the game ends and they may restart the game to attain a higher score.
Note: Pterodactyls only start spawning at 350 points.
Key | Usage |
---|---|
Enter | Starts the gameplay once the program is run. |
Q and ESC | Either can be pressed to close the program. |
Space and UP | Either makes the player jump. |
DOWN | Makes the player duck. |
Inspiration was taken from Google's development of the original Chrome game. Before the browser game was released, Google gave the project the codename "Project Bolan,", naming it after Marc Bolan, the lead singer of the 1970's band, T-Rex. As such, while the game is more often referenced today as the "Dinosaur Game," "T-Rex Game," or "Dino Runner," this project's name, "Bolan.py," was chosen to honor its parent's past pseudonym.
While the game was made to best mirror that of the original's, it does have its shortcomings. Specifically, it has yet to support a proper day/night cycle. As of now, the author does not have any intentions of adding such a feature to the game but it would make for a great contribution to the repository.
The project makes use of a single sprite sheet to blit its 2D assets onto the screen. This was done in order to increase performance instead of using multiple differently blitted image files. In doing so, the author made use of a borrowed version of Eric Matthes's SpriteSheet
class in order to effectively manipulate the images in the sheet.
For reference, the SpriteSheet
class used by the repository can be found in spritesheet.py
.
Note: Skip the first step if Python 3 is already installed on your computer. You may also skip step two if you already have Pygame installed.
-
Install Python. Version 3.8.3 and above is recommended.
-
Install Pygame. Version 2.0.0 and above is recommended.
-
Clone the repository (or download it as a .zip file and extract it).
-
Navigate to the repository's
/bolan
directory and runmain.py
. One may do so by double-clickingmain.py
or by using a command line interface and entering the following:$ python3 main.py
If that doesn't work, one may also try entering
python main.py
instead of the above.
Pull requests are welcome for those that would like to make a contribution. On that note, for those that would like to apply major changes to the repository, we'd like to request that you open up an issue first and discuss the changes you'd like to make.