Skip to main content

You are a dinosaur, and you have to dodge the meteors by moving the mouse. If a meteor hits you, you lose a life. Hopefully, you always can eat a ham to recover some lives.

I made this game to learn how to use pygame in my 2nd year of my studies. I recently updated it to support Python 3, and to polish a bit the project (mainly translating the comments and code into English).

I also left the original one in first_version folder just for the old times :D

I recently uploaded the application to https://pypi.org/ to learn how to publish Python packages.

Installation

This app is uploaded in https://pypi.org/. To install and run it, you just need to (you may want to run it on a virtualenv):

pip install dinosaur-pygame
dinosaur_pygame  # The game is installed as a script, just needs to run that command for the game to start.

Local Development

You may need to install some prerequisites to make pygame work. Once they are installed, to install the project:

make install
# `make clean` can be run to reset the project to a clean state

To run the application:

make run

To install the package and check if it works before publishing the new version into https://pypi.org/:

make install_package  # This will run the game as a console script after the package has been built.
dinosaur_pygame  # manually checks if it runs properly in the console. Run this with your venv activated.

Good starting documentation for pypi packages: https://packaging.python.org/tutorials/packaging-projects/ and https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html#the-console-scripts-entry-point.

To publish the new package in test pypi

This will upload the package to test pypi. This is a good way of testing if the package will work before publishing it into the real pypi.

make upload_package_to_test_pypi  # it requires the test token
python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps dinosaur-pygame=={VERSION}
dinosaur_pygame  # Run the app

To publish the new package in pypi

Once every change have been thoroughly tested, we can upload the new version into the real https://pypi.org/.

A new version will be needed (setup.py), as existing versions in pypi cannot be modified.

make upload_package_to_pypi  # it requires the token
pip install dinosaur-pygame  # a version can be specified by dinosaur-pygame=={VERSION}
dinosaur_pygame  # runs the app

Art

For the new version, I got the images from https://opengameart.org/:

Author: Alberto Morales

Release files for dinosaur-pygame 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dinosaur-pygame 0.0.7
File Size Uploaded
dinosaur-pygame-0.0.7.tar.gz 108.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dinosaur-pygame 0.0.7
File Interpreter ABI Platform
dinosaur_pygame-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 220.8 kB

Release files / dinosaur-pygame-0.0.7.tar.gz

Download URL dinosaur-pygame-0.0.7.tar.gz
Size 108.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8a3dd6b8fe6cfdc000adfede2cc665c9fa247ddbfee33af07218ef6d1c124739
BLAKE2b-256 checksum
How to use checksums
512f20b96ddf17cbaba1d2e4dd898a56f2d58679ee6401107e02cfa18aa5e65e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3

Release files / dinosaur_pygame-0.0.7-py3-none-any.whl

Download URL dinosaur_pygame-0.0.7-py3-none-any.whl
Size 112.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7c74be3fa7709eaf56392fe301ac3c910d241e44d37abee9b8d7f86626efc5f
BLAKE2b-256 checksum
How to use checksums
92742451ef10bd597b84d02415572a8b8c26ffe7f9187466330628b6e5f91099
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3

Release history Release notifications | RSS feed

0.0.9

2 release files

0.0.8

3 release files

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page