Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / partical lib

Author
Message
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 23rd Mar 2004 05:21
here's my particle library It's more or less untested because I haven't implemented it into my engine just yet, i think ill do that in a few days..

Its very handy, you specify a particle emitter by ID number, 0 thru virtually unlimited, each particle in the emitter is given certain properties based on how you called the configure functions..

and then a single "UPDATE_PARTICLES" function needs to be called and that's it every single particle's property is available at any time anywhere in the program, so you could get some nifty things going on... you can change them on a global scale or just a single particle to your likeing I hope you like it!

http://www.dbspot.com/j2dstudios/misc/particles.zip

The Unofficial DarkBASIC Magazine : http://www.dbspot.com/j2dstudios/
Cyberflame
20
Years of Service
User Offline
Joined: 4th Sep 2003
Location: Im not sure....
Posted: 23rd Mar 2004 23:55 Edited at: 23rd Mar 2004 23:56
Cool, I'll try it in my game when I get to that part of the dev stage of my game.. Probly by saturday..

Nice water effect!

Could you rem it though?

DANGIT NEO, YOU CHANGED THE CODE AND NOW THE MATRIX WONT TEXTURE RIGHT.
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 24th Mar 2004 02:02
what water effect, that's the particle library

You choose what kind of particle you want.. how big it is, and its x y and z velocities, this means it can work for smoke, rain, snow (with some work), and just about anything else, trails..whatever

I updated it with some few fixes, no new features yet, but soon for some more basic functionality..

Also in the new version i made a fountain so you can see the particles surrounding some basic scentery.

The only part of the code you need to include is the plib.dba and then just call the functions similar to how they are called in the demo Good luck

The Unofficial DarkBASIC Magazine : http://www.dbspot.com/j2dstudios/
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 24th Mar 2004 03:05 Edited at: 24th Mar 2004 05:07
well i took a few more hours into it, and updated it a lot more, lots of bug fixes, and two new features

POSITION_EMITTER(id,x,y,z)
POINT_EMITTER(id,x,y,z)

edit: wow i didn't think my proggy was so buggy, changed some function names, fixed a lot more bugs, and added some functions to break it up a little... should be a little faster and a little more useful

The Unofficial DarkBASIC Magazine : http://www.dbspot.com/j2dstudios/
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Mar 2004 17:00
No sin or cosin calls. Might be faster than mine then. We'll see, Oh we will see!

"eureka" - Archimedes
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 24th Mar 2004 20:21
well, it does require quite a bit of variables and variable calls. Then again its a very verstatile lib, so I would say that if your game only requires one or two particle emitters that don't really change or anything, to just make a simple particle generator on your own...

However if you need to change the velocities of the particles, appearence, stop and start them and move em around, then this library is very effective

The Unofficial DarkBASIC Magazine : http://www.dbspot.com/j2dstudios/
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 29th Mar 2004 07:11
well, I think ive got all the functionality i need done in this library...

The documentation hasn't been updated yet, so just follow the example code and you should figure it out...

any bugs please report them

I should have the docs updated in a few days or so...
If there's any features you think are missing please advise!!

The Unofficial DarkBASIC Magazine : http://www.dbspot.com/j2dstudios/

Login to post a reply

Server time is: 2024-05-13 08:21:15
Your offset time is: 2024-05-13 08:21:15