April 20, 2024, 05:29:05 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


A Show for the Fourth of July

Started by GWS, July 03, 2011, 03:32:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GWS

July 03, 2011, 03:32:00 PM Last Edit: July 03, 2011, 08:54:03 PM by GWS
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
Tomorrow may be too late ..

Doc

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-

GWS

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
Tomorrow may be too late ..

jerryclement

 8)  Graham,

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

HAPPY 4TH of JULY!!

JerryC
Jerry - Newbie from TN

GWS

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

Tomorrow may be too late ..