Sunday, December 13, 2009

Compartmentalization and a Particle System

I got some time to code this weekend... had nothing else to do and my family is busy with a sleep-over which strangely enough appears to free up my time at this age :)

COMPARTMENTALIZATION
I've torn TileMax apart!  Quite literally.  I was finding it getting difficult to know what I was going to effect my making a change... I recall someone (who shall remain namelessly Brucey ;) who always says "Think about the design"...  so I did!  I took the time to separate all the sub-systems into separate files... I now have:

Import "TMConvenience.bmx" ' Convenience Functions
Import "TMAnim.bmx" ' Animations Control
Import "TMTileEngine.bmx" ' Tile Map System
Import "TMPoly.bmx" ' Polygon Transforms and Collisions
Import "TMGUI.bmx" ' Graphical User interface & Hud
Import "TMTiming.bmx" ' Delta time controls
Import "TMScene.bmx" ' Contains controls for switching screens
Import "TMSound.bmx" ' Music and Sound FX
Import "TMParticleFX.bmx" ' Particle Effects and Emitters
Import "TMInput.bmx" ' Input Controls
Import "TMLanguage.bmx" ' For Creation and use of language files
Import "TMFonts.bmx" ' For displaying fast text

Keep in mind some of those near the bottom are complete minimal implementations and not at all finished products.  After that I started on...


PARTICLES
So I've looked at several options for a particle system, one obvious one is TimeLineFX, but I hate licensing issues so thats out.  I found several "basic" particle systems but thats just too basic for me.  So what did that leave me with... Make my own of course!

So what I have now is an interesting system... Each particle can have all its velocity, alpha, etc managed by this sequencer system... The sequencer system has a start value and end value which is traversed by a speed value that is in percent per ms.  The sequencer has several modes... Once, Bounce, Roll, or sequence... which means it has sub-nodes for fancy stuff.

Obviously, those particles has to be created somewhere, so there are Emitters (extension of a particle) that can have its angle, spread, etc managed as well by sequencers.  Particle or Emitter death's can spawn an array of Emitters or particles as well.

So I can't really think of much more a particle would want to do.. I could extend them from the GameObject type and allow them to be effected by the force effects in the TileMap... I'll have to think about this one as it involves adding overhead to the movement which from a particle standpoint is no good!


No comments:

Post a Comment