Skip to main content

Asteroids game

Project description

pyroids

screenshot.png

Asteroids game with features including:

  • 1 or 2 player
  • Multiple weapons
  • Expendable ammunition
  • Supply drops
  • Radiation exposure
  • Highly customisable - you make the game!

Installation

The simplest way to install pyroids is directly from PyPI:

$ pip install --upgrade pyroids --user

Alternatively

Install from the source distribution on github:

$ pip install git+https//github.com/maread99/pyroids.git#egg=pyroids

Install from a source distribution stored locally:

$ python setup.py install --user

Requirements

pyroids requires Python 3.6+ (employs annotation syntax).

The only dependency is pyglet 1.4 which, if not already installed, will be installed as part of the pyroids installation process.

Play me!

Once installed, pyroids can be launched directly from the command line or via the launch() function.

From the command line:

$ python -m pyroids.play

To launch with settings defined by a configuration file (see Game Customisation section), for example 'expert.py':

$ python -m pyroids.play expert

If pyroids was installed via pip then the application *might also launch with default settings with a simple:

$ pyroids

* requires that the Scripts directory, of the python environment to which pyroids was installed, is included to the PATH environmental variable.

Using launch function:

>>> import pyroids
>>> pyroids.launch()

To launch with settings as defined by a configuration file (see Game Customisation section), for example 'novice.py':

>>> pyroids.launch('novice')

Game Customisation

Settings that can be defined for each level include:

  • Number of Asteroids
  • Number of times each original asteroid will break up into smaller asteroids
  • Number of smaller asteroids each asteroid breaks up into
  • Asteroid speed
  • Ship Speed
  • Radiation field
  • Radiation exposure limits
  • Number of supply drops

Settings that can be defined for the duration of an application instance include:

  • Ship Controls
  • Asteroid behaviour on reaching window border
  • Initial ammunition stocks per weapon
  • Frequency and number of supply drops
  • Min and Max ammunition stocks in each supply drop (per weapon)
  • Cannon reload rate
  • High Velocity Bullet speed
  • Shield duration
  • Number of Levels
  • Number of Lives
  • Window dimensions

Settings can be customised by creating a configuration file and passing the configuration file's name when the application is run (see Play me! section). If no configuration file is passed then the game will use default settings. See pyroids\config\template.py documentation for instructions to set up configuration files.

The following example configuration files are included as part of the pyroids' distribution:

Aside from the configuration files, the ship and asteroid images can be changed with a little investigation of the source code and some minimal hacks.

Not feeling the love

$ pip uninstall pyroids

Licensing

Code

See LICENSE.txt.

Media

See pyroids\resources\README.md.

Code Documentation

Function and method documentation:

  • does not by default list all optional and keyword arguments, for which signatures should be inspected.
  • does not state argument types or return values, for which signatures' annotation should be inspected.

Names referenced in documentation are surrounded by symbols that identify the nature of the assigned object:

Name Nature of assigned object
+parameter_name+ Parameter of documented function or method.
++parameter_name++ Parameter of class constructor method.
-variable_name- Variable local to code being documented.
--attribute_name-- Instance attribute.
--method_name(args, kwargs)-- Instance method. Only args / kwargs referred to in the subseqeunt documentation are noted. Signature should be inspected for full parameters.
---classmethod_name()--- Class method or static method.
----global_constant_name---- Global constant.

Issues

Please use the project's issue page to report any issues.

Contact

Marcus Read

Project details


Download files

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

Source Distribution

pyroids-0.9.0.tar.gz (7.3 MB view details)

Uploaded Source

Built Distribution

pyroids-0.9.0-py3-none-any.whl (7.3 MB view details)

Uploaded Python 3

File details

Details for the file pyroids-0.9.0.tar.gz.

File metadata

  • Download URL: pyroids-0.9.0.tar.gz
  • Upload date:
  • Size: 7.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.0

File hashes

Hashes for pyroids-0.9.0.tar.gz
Algorithm Hash digest
SHA256 741cd3274575a0c875f669b7e6eff170d824d38a0ef4457b8d0228500eda0320
MD5 e85e60844c123bba81773d7e6dd8a480
BLAKE2b-256 5bef06d0ba2fd4ba55c3bf61451321f5e63617c7d859b0c5288908c715e78f23

See more details on using hashes here.

File details

Details for the file pyroids-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: pyroids-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.0

File hashes

Hashes for pyroids-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d70ed06d030e1e63c2e136b9c5243c00564d239455cf87798e6816e972deda9d
MD5 54dc01242bb6e8d325aec15c0c38e97f
BLAKE2b-256 ff040d9b1118641827b5e1019310ff30a6b3f5caedcb307db2ddd6b4e5bd9bb0

See more details on using hashes here.

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