In Oak, we have four groups of particles:
- Color particles, which can be assigned a start color and end color for however long they last, smoothly transitioning from one to the other.
- Gradient particles, which are just like color particles but can have their particle be a circular or horizontal gradient, or something similar.
- Sprite particles, which throw away 'being lightweight' and just serve as generators for sprite images or other renderable types in the engine like animations.
- Collision particles, which wrap around any other particle but contain a collision space so they can react to the game environment.
Oak's particle engine is based off of CraftyJS's particle engine, with significant modifications (and written from scratch, as we're in a different language). Some settings a particle can have are how gravity affects them, how much they rotate per frame, how fast they move, what angle they move at, and so on. Below is a demo of how most of these effects change a single color particle source:
The code used to make this demo (which is an oak program) can be seen here, (although it needs some documentation!)
No comments:
Post a Comment