Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Snow? The Beginnings of a Particle Engine?
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
[Gandalf]




PostPosted: Mon Jun 20, 2005 7:29 pm   Post subject: Snow? The Beginnings of a Particle Engine?

Well, I was looking back at Catalyst's manifestations and I thought what they hey. This might not compare at all, and I'm not even sure what a "particle engine" is supposed to be, but its a start. It's not a FP or anything, but I'm probably going to work on it for a while since I haven't really done much large projects on Turing.

Tell me some basic ways to improve it. If it gets good enough I might post the source. I got the movement idea from Catalyst's "Pinwheel" one.

So yeah, what the heck - here it is:



Gandalf's Particle Engine Start.zip
 Description:
Particle Engine Possible Start

Download
 Filename:  Gandalf's Particle Engine Start.zip
 Filesize:  272.74 KB
 Downloaded:  201 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Mon Jun 20, 2005 7:45 pm   Post subject: (No subject)

Pretty good. Now I see why you were asking about the types. Now that I understand, here's the real answer Laughing
code:

var snowFlake : flexible array 1 .. 0 of
    record
        x, y : real
        %maybe you needed vx and vy, or angle and velocity, etc.
        %whatever else you used for the clumps of particles goes here
        particle : array 1 .. 15 of
            record
                x, y : real
                %any other variables
           end record
    end record

Since each snow flake has the same number of particles in it, this is fine. If each snow flake could have a varying number of particles, you'd have to use a flexible array inside the record, which is illegal in Turing. Rolling Eyes
Is that how you did it?

Good work. +15 bits
[Gandalf]




PostPosted: Mon Jun 20, 2005 8:00 pm   Post subject: (No subject)

Thanks for the help and the bits!

For the example I posted I took out all the other variables to make it simpler, but I do have some. No, I didn't do it that way, but I did have the same amount of particles in each snowflake. Now I see that yours is much better Smile. I'll change it as soon as I have some more time.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: