GithubHelp home page GithubHelp logo

dylannalex / explosion3d Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 1.0 1.91 MB

Amazing 3D explosion animation using Pygame module.

License: GNU General Public License v3.0

Python 100.00%
explosion animation pygame

explosion3d's Introduction

3D Explosion Animation ๐Ÿ’ฃ ๐Ÿ’ฅ

๐Ÿ”ฅ Amazing explosion animation with Pygame.

๐Ÿ’ฃ Explosion physics

An Explosion instance is made of a set of Particle objects. Those particles are fireballs which behavior is determined by a random generated velocity vector.

Particle movement:

particle.velocity = [vx, vy, vz]

vx determines how fast a particle moves to the right or to the left.
vy determines how fast a particle moves up or down.
vz determines how fast a particle moves closer to the screen.

The effect of making a particle going off the screen is achieved by increasing the particle radius and brightening its color.

๐Ÿ’ฃ Explosion parameters

explosion = Explosion(
    particle_size, total_particles, x_expansion, y_expansion, screen.window
)

particle_size sets the initial radius of the explosion particles.
total_particles is the number of fireballs in the explosion.
x_expansion sets how much the explosion expands to the right and to the left.
y_expansion sets how high the explosion expands.

๐Ÿ’ฃ Requirements

This project uses the Pygame module. You can install Pygame with:

$ pip install pygame

๐Ÿ’ฃ Usage

The main file is start_explosion.py. You can run the animation with:

$ python -m explosion.start_explosion

When you execute the project black screen will be displayed. Just click somewhere in the screen and BOOM:boom::boom:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.