Flame thrower effect

Hi, 

In our game we have a flame thrower, currently we are using sprites for the flame but theres alot of images and we have to have separate sprite sheets for every angle. So im looking to see if theres an alternative way of achieving the flame without images. Can this library achieve a flame thrower effect? for example something like this https://www.youtube.com/watch?v=0batxTFb1Ag

Absolutely. You’ll need a single flame particle image, possibly animated for best effect, then you can just fire (heh heh) the particles out (there’s a simple hose demo that can be tweaked in the samples directory) and add a velocity damping. Then, you’d just need to tweak it to your desires.

In slightly more in-depth terms:

Find the “hose” demo in the samples directory, then swap out the graphics and turn off cycle angle. Add a bit of velocity damping. Tweak to your desired appearance.

  • Caleb

Thanks, so I got something like this so far 

    local vent = CBE.newVent({

        title = “flame”,

        positionType = “atPoint”,

        build = function() return display_newImageRect(“CBEffects/textures/glow.png”, 40, 20) end,

        color = {{0.5, 0.2, 0}, {1, 1, 0}, {1, 1, 0}, {0, 0, 0}, {0.784, 0.784, 0}, {0.784, 0.784, 0}, {1, 0.392, 0}},

        inTime = 10,

        lifeTime = 200,

        outTime = 400,

        startAlpha = 0,

        emitDelay = 10,

        perEmit = 3,

        particleProperties = {blendMode = “screen”},

        physics = {

            velocity = 4,

            angles = {{0,10}},

            cycleAngle = false,

        }

    })

What would you suggest for the image, do you have an example?

Thanks

Flame textures are usually just little smudges or blobs with a lighter part; for example http://www.astralax.com/images/articles/inflames/textures_big.gif. Textures like that may not look like flame right off, but if you put them in a particle system and move them, fade them, etc., they make for a good flame. I don’t have a flame texture on hand right now, but they’re not hard to make.
 

  • Caleb

Absolutely. You’ll need a single flame particle image, possibly animated for best effect, then you can just fire (heh heh) the particles out (there’s a simple hose demo that can be tweaked in the samples directory) and add a velocity damping. Then, you’d just need to tweak it to your desires.

In slightly more in-depth terms:

Find the “hose” demo in the samples directory, then swap out the graphics and turn off cycle angle. Add a bit of velocity damping. Tweak to your desired appearance.

  • Caleb

Thanks, so I got something like this so far 

    local vent = CBE.newVent({

        title = “flame”,

        positionType = “atPoint”,

        build = function() return display_newImageRect(“CBEffects/textures/glow.png”, 40, 20) end,

        color = {{0.5, 0.2, 0}, {1, 1, 0}, {1, 1, 0}, {0, 0, 0}, {0.784, 0.784, 0}, {0.784, 0.784, 0}, {1, 0.392, 0}},

        inTime = 10,

        lifeTime = 200,

        outTime = 400,

        startAlpha = 0,

        emitDelay = 10,

        perEmit = 3,

        particleProperties = {blendMode = “screen”},

        physics = {

            velocity = 4,

            angles = {{0,10}},

            cycleAngle = false,

        }

    })

What would you suggest for the image, do you have an example?

Thanks

Flame textures are usually just little smudges or blobs with a lighter part; for example http://www.astralax.com/images/articles/inflames/textures_big.gif. Textures like that may not look like flame right off, but if you put them in a particle system and move them, fade them, etc., they make for a good flame. I don’t have a flame texture on hand right now, but they’re not hard to make.
 

  • Caleb