Skip to main content

patternengine

Project description

patternengine

tl;dr

A bullet hell pattern engine

Consult the embedded docs for class descriptions and usage.

Check out the demo. Watch the demo running

Look into src/patternengine/example.py

Preparation

########################################################################
# Relevant part here
#
# A "ring" of 180 degrees aiming towards the top devided int 18 parts
# A heartbeat over 5 seconds with 4 emits and 4 gaps
# A BulletSource fetching 18 bullets at every heartbeat
#

ring = pe.Ring(100, 18, aim=-90, width=180)
heartbeat = pe.Heartbeat(5, '#.#.#.#.')
emitter = pe.BulletSource(18, ring, heartbeat)

#
########################################################################

Later in the game loop

####################################################################
# Relevant part here
#
for bullet in next(emitter):
    Bullet(group,
	   position=bullet[0] + anchor,
	   momentum=bullet[1] * bullet_speed,
	   lifetime=10)
#
####################################################################

with Bullet being a simple subclass of pygame.sprite.Sprite

Tutorial

Read TUTORIAL.md for exhaustive examples of all the parts.

Additionally, study the sources of the included tutorial scripts and the demos, both in the package folder.

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

patternengine-0.0.6.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

patternengine-0.0.6-py3-none-any.whl (47.2 kB view details)

Uploaded Python 3

File details

Details for the file patternengine-0.0.6.tar.gz.

File metadata

  • Download URL: patternengine-0.0.6.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for patternengine-0.0.6.tar.gz
Algorithm Hash digest
SHA256 1bb75e56161924a41f8ab2693568bd06468b80ecfbfc066618296ca4bc654536
MD5 a5db648ebfcdecb8f1429219b114921e
BLAKE2b-256 c546dd9ae140f343ef6d75785e4ece225d1a78722a849bc5478558cecccce862

See more details on using hashes here.

File details

Details for the file patternengine-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: patternengine-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 47.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for patternengine-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c006435d1590d6b623d9c740c2db32f3b3abdc1823981ddbb6e7780fc83da2a4
MD5 76c68c661f3b5515c7d0b209d32f1c39
BLAKE2b-256 14f98fb69849364d22022cc8e5e30f3389d067a32f5a842c3ca54c944760b747

See more details on using hashes here.

Supported by

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