black smoke

Blitz3D Forums/Blitz3D Programming/black smoke

Ben(t)(Posted 2008) [#1]
hello all, I have a quick question.
how can I make a black sprite that will still be able to fade away.

Im going for something like flac smoke in Frontlines: fuels of war where it appears in the game and then fades away


mtnhome3d(Posted 2008) [#2]
look for a sprite example in the samples folder that came with blitz
as for making it fade you need to set entityalpha mysprite.entity,1(ish)
and later in the update part of your code set it to a variable that you decrease slowly, just make sure that the variable is a float#.


Kryzon(Posted 2008) [#3]
What mtnhome3d said, but also make sure the image is bigger than the sprite's gradient, meaning: don't let your smoke sprite touch the borders of the image when you're drawing it, or else the in-game sprite will have some square-shaped borders.

In case you need a practical example, I just uploaded this thing I was going to use for a grenade explosion - I like doing stuff like this so I have a library of "special effects", like Screen-Fades, MotionBlur, Sprite Positioning, etc. Every sprite you see in the example was drawn by me in Photoshop 5, and I "grant you and everyone to do whatever they want with the sprites or the code". The sound effect is not mine.

Make SURE you unzip all the files in the same folder, and create a folder first, like, SmokeTest and then unzip the contents to it.

Link: http://www.freewebs.com/rafael_navega/GrenadeExplosion.rar

If you or anyone got any questions about the example, feel free to ask.


Drak(Posted 2008) [#4]
Here's an example. Import a png file to get a better idea of how it looks. Basically this creates a sprite and fades it for you.




Ben(t)(Posted 2008) [#5]
thanks for the help and the code example guys, it was helpful, although I guess I didn't word my question right, I just needed to know how to make a white smoke sprite black.


Buggy(Posted 2008) [#6]
Hmm... I think fancier editors like Adobe Photoshop can probably do that with ease. I use MS Paint, and my only idea is the invert colors option. Unless, if the whole image is one color, you could use the fill tool.


Kryzon(Posted 2008) [#7]
Well, if you're using Photoshop, just press CTRL+I to invert the colors of the entire image. Black turns to white, blue turns to orange (opposite colors :-) ), etc. But I quite don't get what you're trying, since if you've got a white smoke sprite, it's just another tone of black (with 100% power). What's the problem in making it a little dark-gray?


Ben(t)(Posted 2008) [#8]
I wanted to make missiles that you could see coming from farther away, plus, flack smoke generally is very dark