Another day, another extension (this one you might have seen me use on stream on Monday). I present: riknoll/arcade-fire-sprites!
This is an extension for creating procedurally generated fire effects like this:
To create a fire effect, you first need to create a fire spawner. Fire spawners manage the number of fire simulations running at once. If you are spawning a lot of fire sprites, the spawner will reuse existing fire simulations instead of creating new ones, which improves performance. The number of simultaneous fire simulations is determined by the max sources parameter in the create spawner block.
All fire sprites from a spawner share the same dimensions, strength, color ramp, and update/sputter intervals. If your game needs different types of fire, you should create one fire spawner for each type (e.g. one for lanterns, one for campfires, one for attacks, etc.).
Anyways, give it a shot! All of the blocks should have help pages (right click on the block and select “Help” to open)
this block is a copy of the definition of the the one used in the sprite block but it has the initWidth and initHeight properties set to specify the default image size.
then, in the definition for the set color ramp block, i set the shadow of the image to the blockId of this function:
and as for what made me want to make this extension, i had this code lying around from a while back (i used it in bug arena) and i wanted to reuse it in the zelda-inspired game we’re working on in livestream right now.
i just updated the extension so that small fire sprites (smaller than 40x40 pixels) now support rotation and scaling:
you can rotate and scale them just like normal sprites (e.g. using the properties in the sprite dropdown).
large fire sprites (greater than 40 width or 40 height) do not support scaling or rotating, and behave exactly the same as before. this is because of the optimizations in the extension for large fires and i won’t be fixing it. so if you want a big fire that you can rotate, maybe try using several smaller fires.