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.

2D All the way! / 2d particle system

Author
Message
Cave Man
18
Years of Service
User Offline
Joined: 22nd Aug 2006
Location: North Carolina, US
Posted: 5th Sep 2006 00:00 Edited at: 5th Sep 2006 00:07
Hi all, i made a 2d particle system for the project im working on. I decided to release it here.

Here's a screen of the example


Here are the functions

with the Make2dparticles function
you set a range that it will randomly go in that direction
xlow power is the lower power so that must be smaller than xhigh power

xhigh power is the opposite
the same things apply for y low power and y high power

Make sure you remember the for the ypower, a negitive value makes it go up.

also, with the example i attached, mae sure you comment out 2 of the make particles function in the main loop. If you use all three at once then it will run very slow like on the screen that is above.

The attachment is the example with media and is zipped.

Have fun!


Cave Man


Language: DBP 6.2
Cream cheese is your enemy. Sweet tea is your freind.

Attachments

Login to view attachments
DarkMasta
19
Years of Service
User Offline
Joined: 21st Apr 2006
Location: Typed on your screen.
Posted: 14th Sep 2006 15:53
Well, thanx CaveMan. Seems to come quite in handy for my fully 2d based game. If I can fit your module in there, you can take some o' the cred's, if yer like ter.

Wherever you plan to go,
it's the next step you never know.
DarkMasta
19
Years of Service
User Offline
Joined: 21st Apr 2006
Location: Typed on your screen.
Posted: 15th Sep 2006 17:25
Ingenious, wonderfully transparent coding. Btw, since I am quite clumsy at using advanced basic 2d tools at DB, would you mind to enhance your by appending an extra option to your function, in which the particles fade out as they proceed? It would complete your tool, I think.
But I'll try to add this option on my own, if you don't want to get bothered with that...
Gone ter work:
??????

Wherever you plan to go,
it's the next step you never know.
DarkMasta
19
Years of Service
User Offline
Joined: 21st Apr 2006
Location: Typed on your screen.
Posted: 15th Sep 2006 21:06
I've applied your 2d-Particle functions on a quite needy standard of rocket incandescence. P'raps you might be able to pep up my meddly coding. As another hint: Try to make the particles you create more independent from each other.
I'll try to clean up my derivation of yours, rounding up some half-bugs and inconvenient side-effects...

'HOPE I HELPED:
Here's my suggestion:


Wherever you plan to go,
it's the next step you never know.
DarkMasta
19
Years of Service
User Offline
Joined: 21st Apr 2006
Location: Typed on your screen.
Posted: 18th Sep 2006 14:24
The 2dparticle idea is quite handy for all sorts of effects. I'll paste this message last until you respond — if you ever intend to do, Cave Man, but perhaps you could generalise the 2dparticle function a bit more. Its a thing, that's worth bein' perfectionised and rounded up.

I still don't get, what all the options in the function do, for example "xlp" or "yhp", perhaps lowest x deviation and the highest y deviation.

Just don't let it stand that way please.

Wherever you plan to go,
it's the next step you never know.
Cave Man
18
Years of Service
User Offline
Joined: 22nd Aug 2006
Location: North Carolina, US
Posted: 18th Sep 2006 22:47 Edited at: 18th Sep 2006 22:52
Hi. I havn't come here because i thought the 2d board was completly dead and i had given up hope that anybody would answer.

All the xlp yhp and all that are the ranges for a random number that will be chosen for the speeds of each particle.

The parameters "xr" as "yr" are the chaos of each particle. If you don't use these, the particles will go in strait rays.

BTW, after a while, i found that that much smoke is ineffeicient. so it's probly better to do it once every 2 or 3 flicks. Also i think the snow is horribly ineffecient.

Heres the timer for the smoke thing:



The shift 2dparticlesx and y are if you're doing a 2d sidescroller and need to move all the particles in one direction.

I used this in a 2d sidescroller i made.(High-Fire on my signiture.)

One more thing. I think i'll do what you asked about the fading. And i'll also add a rotation parameter.

Your signature has been erased by a mod because it's larger than 600x120
DarkMasta
19
Years of Service
User Offline
Joined: 21st Apr 2006
Location: Typed on your screen.
Posted: 19th Sep 2006 17:46
Oh, great. I've already thought, something serious has happened to you. Well, I'm quite fond of your particle system. If I manage to integrate the 2dpartics and finish my game (which won't be ere a month or two, because of my lack of freetime and my slowness in coding) I'll show you the result right away.

Would be kind to make a rotation option in your particle function.
So, as far as I was able to understand:
xlp/xhp = lowest/highest x-speed of a particle
ylp/yhp = lowest/highest y-speed of a particle
xr = x-derivation of a particle
yr = y-derivation of a particle


It's nice we can collaborate a bit. I don't know where anymore, but some other people tried to do the same thing, titled "smoke effect" somewhere in the 3d-sector — although it was 2d all the way through.

But personally, I've got two left hands (if any hands at all) for the 3d-part in DB and as a matter of fact, I've always preferred 2d since I started programming. Its cheaper (forget about all those auxiliary programs, such as Texture Editor, Model-programs, etc. etc.), more relevant, the programer can use artistic abilities and above all you don't need to bother about weird physics and maths that much as in 2d, where you simply can control the whole physical stuff better.

Wherever you plan to go,
it's the next step you never know.
Cave Man
18
Years of Service
User Offline
Joined: 22nd Aug 2006
Location: North Carolina, US
Posted: 19th Sep 2006 18:47
lol my sig got erased. It's 128 height. I'll just go clip off the top and bottom of it. Maybe i should go post this in the code snppets. Thanks for the feedback

DarkMasta
19
Years of Service
User Offline
Joined: 21st Apr 2006
Location: Typed on your screen.
Posted: 19th Sep 2006 21:41
Yeah, I read it:
Quote: "Your signature has been erased by a mod because it's larger than 600x120"

I thought it way to be a very dry, bad joke. You get to read the worst things as a signature with some weirdos these days...

Wherever you plan to go,
it's the next step you never know.
Cave Man
18
Years of Service
User Offline
Joined: 22nd Aug 2006
Location: North Carolina, US
Posted: 22nd Sep 2006 02:44 Edited at: 22nd Sep 2006 02:59
OK I finished V2. I posted it in the CodeSnippets board here : http://forum.thegamecreators.com/?m=forum_view&t=89530&b=6.

If you want to comment on it, post there. Don't bother posting here anymore anyone.

Login to post a reply

Server time is: 2025-05-15 13:29:21
Your offset time is: 2025-05-15 13:29:21