IonicWind Software

Creative Basic => 2D/3D => Topic started by: GWS on July 03, 2011, 03:32:00 PM

Title: A Show for the Fourth of July
Post by: GWS on July 03, 2011, 03:32:00 PM
Hi folks,

Just in time hopefully .. a little fireworks show for the 4th .. ;D

It would probably be better in IWB with more particles, but it's not too bad I think ..

best wishes, :)

Graham
Title: Re: A Show for the Fourth of July
Post by: Doc on July 03, 2011, 09:57:57 PM
Thanks Graham!
Pretty nifty stuff from a really nice guy.

I'm always amazed that as a citizen of the U.K. you always take a bit of time and effort to help those of us here in the states celebrate our independence.

You Sir, make folks there in the U.K. look good and it's appreciated.

-Doc-
Title: Re: A Show for the Fourth of July
Post by: GWS on July 04, 2011, 02:20:29 AM
Doc ..  :) .. how nice to hear from you .. I hope you are well.

As a UK'ite, I feel we owe so much to the USA.  It's been a groundrock to my life, even though I've never been there.

How so? .. I think of all the great music (Artie Shaw, Sinatra, Streisand etc), the wonderful movies, the 'comics' for kids (Captain Marvel, Superman etc), the StarTrek series which entertained us grown-up kids  ;D, the military assistance, and so much more.

So I like to think of this site as a meeting place, and post my little contributions, to try to show interested folk that they can tackle almost any project using these languages, which often are not possible in the large commercial languages without a lot of computer knowledge ..

Happy 4th you guys (and gals),  :)

Graham
Title: Re: A Show for the Fourth of July
Post by: jerryclement on July 04, 2011, 04:42:05 AM
 8)  Graham,

Very, very nice!  I'll have to study your routines.

HAPPY 4TH of JULY!!

JerryC
Title: Re: A Show for the Fourth of July
Post by: GWS on July 04, 2011, 06:15:09 AM
You're welcome Jerry ..  :)

I'm pleased it turned out pretty well .. if you look at the code, you may spot the weakness  :o

It uses a working array of 5000 UDT particle elements:


type particle
def x:float         :' x co-ordinate
def y:float :' y co-ordinate
def vx:float :' x velocity
def vy:float :' y velocity
def col:int :' colour
def life:float :' lifetime
endtype

def p[npmax]:particle            :' particle array


This has to handle details of all the particles.  When it fills up, it wraps to the top of the array, and overwrites whatever is there.  That's fine if the over-written particles have burnt out - but zaps any that haven't.  So it's a fine balance between having lots of particles - a larger array - or shorter lifetimes for particles.

It's fun to play with though.  You might come up with an improved control sequence ..  :)

all the best, :)

Graham