Skip to main content

A simple particles system for pygame

Project description

# Pyticles

Pyticles is a particle system for pygame. It allows you to render particles with velocity and decay rates.

# Classes

Pyticles includes two classes.

  • Particle(image, screen_coords, velocity, decay_time=5, decay_chance=3)

  • Engine()

These are what the system is based around.

# Particles

Particles are simply a class that represents a single particle.
  • Image is the particle texture.

  • Screen coordinates represent the position on the screen.

  • Velocity is how far the particles will go every time the Engine ticks.

  • Decay time is how many Engine ticks until the particle has a chance to decay ( 1 in decay_chance ). Once there has been twice as many ticks as decay time, the particle will instantly decay.

# Engines

Engines contain sets of particles and have 6 functions. You will only need to use 3. The functions are:

  • burst(image, particle_count, origin, scatter=1, displacement=1)

  • draw(particle)

  • tick(surface)

Burst releases a burst of particles at a certain point, marked origin.
  • Scatter is how high the velocity in a certain direction can be.

  • Particle count is how many particles are released.

  • Displacement is the furthest away a particle can spawn from the origin.

  • Image is the particle texture.

Draw will create a single particle, and it takes in a particle class.

Tick takes in a surface to draw to and manage all tasks such as velocity, decay, and drawing.

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

pyticles-1.0.3.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file pyticles-1.0.3.tar.gz.

File metadata

  • Download URL: pyticles-1.0.3.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for pyticles-1.0.3.tar.gz
Algorithm Hash digest
SHA256 9875ef78a184e7b8f4d9f8150bbf2a67639547f5462dfa60bfe8987ee4fb3092
MD5 00a418e6ea2c11a8378e72914078ede3
BLAKE2b-256 dd748d19108d526a80603af277ab7ed4cdf199ec44a9a04c87fb348f1bbd3c26

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