C4Swimmers Newsletter  

(Tutorial) A C# tiny fireworks simulator

Tutorial: A C# tiny fireworks simulator

A tiny fireworks simulator based on simple physical engine. The user can configure 10 launcher with the initial speed of the bomb, the explosion form and the explosion colour. 

Note: This is an unedited reader contribution

Introduction

The purpose of the article is more to present the application than to explain the technical facets of the code which is in fact quite simple. The aim of the application is to display fireworks particles on a dedicated user control. In facts the user control manages a list of fireworks bombs all long of their life cycle; the user can launch at any time a new bomb via the bomb launchers controls on the bottom of the window. 

Description

Each a fireworks bomb contains a list of fireworks particles, on the first time the list consist in only one particle launched on vertical axis; when this particle comes on its apogee it is deleted and new particles populates the list; that particles symbolize the explosion particles.

At each timer tick the simulator control refresh the position of each particles of each bombs. The refresh position is computed by a basic physical engine; in fact each particle has a mass and forces applied on it. The physical engine use the fundamental principle of dynamics : sum of external forces equals the mass multiplied by the acceleration.

The form of the explosion is given by the expression of the initial speed of the explosion particles. The application implements 10 different explosion form; from basic (circle) to more strange ... Further more to try to improve the similarity a fader effect plays on the particles.

| Read More..

Courtesy: Codeproject.com