Simple particle test

edited October 2008 in Projects - Tools

I recently stumbled upon PTK. To be exact, a friend sent me the URL. ;)

Anyway, I've seen they had 2 examples and I was curious to see how another 2D-oriented game engine (but one with real users/customers this time :P ) handled examples.

I read their particle example and was curious to see how it'd look like if done similarly with orx. So I gave it a quick try.

It's not a perfect copy of ptk sample, but it's close enough.
Thanks to orx's config system, with fewer lines of code it's more flexible and can be tweaked in a lot of different ways. B)

Of course this is just a test as particles are currently created as full objects and there are lots of optimizations that could be done to achieve a real particle system. But still, I think it's encouraging and I hope people might want to try the engine a bit more now there's a gallery section with some screenshots. :cheer:

Give me your thoughts! :cheer:

- iarwain

PS: An archive containing the source/binaries for windows can be found here.


  • edited October 2008
    Hop, the archive has been updated. I played a bit with the same particle test but changed some parameters and the texture.

    The second test is using BlendMode=add. Makes it looks closer to the original. :laugh:

    You can switch from the first test to the second one by uncommenting/commenting the last line in particle.ini
  • edited March 2009
    I've updated this test with the latest orx version (here).

    The particle test is now completely data driven: no more code to updated particle speed, it's all done in the config file. :)

    If you're not looking at the 2 main functions (I put a WinMain so as to have a version without console), the code is less than 20 lines total (actually there are really 4 lines of code, everything else is include, function declarations and brackets).

    You can play around with the particles using the config files. A nice first approach is to try uncommenting one (or both) of the last two lines from particle.ini.

    I think I'll use this code as a base for a tutorial on spawner. You can even add physics to the particle without having to write a single additional line of code. ;)

    Any feedback is welcome, as usual! :P

    PS: You can compile it under linux or MacOS X but I only included msvs2008 build files and release binaries so as to keep the zip file as light as possible.
  • edited May 2009
    Just a quick message to say that the test has been updated again. It now uses the embedded version of orx (core + plugins are all in orx.dll) and uses a stronger data-driven approach.

    Actually you can even add your own presets for the particle directly in the config file and test them without having to restart the executable.
    This test is now very similar to the 11th tutorial I wrote for orx that will be released along the v1.0 version.
    You can find it here.
  • edited May 2009
    Today I had about 30 mins spare time, so I added 4 new presets to the particle test, without touching its code.
    2 of these presets give some "fusion/melting" effect (which I personnally find pretty neat ;)), and the 2 others use a shader to add a colorized overdraw (it will only work if your graphic card support pixel (fragment) shaders).

    I've also added the 2 template files so you know which config options you can change and what will be affected.

    The download is still here.
Sign In or Register to comment.