GunFlash

Blitz3D Forums/Blitz3D Programming/GunFlash

cash(Posted 2005) [#1]
I am sure this has been asked before but I cannot find it.

I have several ways to create the gunflash itself but am having trouble actually getting it into the game.

If I use an animimage then the animation does not go smoothly (one frame per mousehit rather than entire sequence).

Also the images do not mask very well.

Any code out there to give me some kind of random gunflash effect. I dont mind how as long as it looks half decent.

Thanks


Rook Zimbabwe(Posted 2005) [#2]
You could use sprites and rotate the sprite randomly each time you call it???
-RZ


jfk EO-11110(Posted 2005) [#3]
What rook said. I takeit you want gunflashes for a 3D Game, probably FPS or TPS? THe single SPrite Gunflash is the quick solution and looks rather impressive. If you want them to look realisticly, then you should consider that the flashes only take about 1/20seconds. So they shouldn't remain longer than 2 or 3 frames. but also a one frame flash should work.

In serial fire mode it may look much better if you rotate the Sprite randomly each round.

As for a deluxe version and a couple of muzzle flash images go here: http://www.matthawkins.co.uk/index.php?module=pagesetter&func=viewpub&tid=5&pid=36
(nice page overall, check the fx section as well)


cash(Posted 2005) [#4]
The images I am using are going to be masked bitmaps. Due to the nature of the effect, edges are blurred. However this shows as a black border on the screen. Any suggestions.


Rob Farley(Posted 2005) [#5]
Forget using masked textures, just use add blend.


cash(Posted 2005) [#6]
Thanks

A combination of sprite, rotation and alpha and a small piece of code to display the sprite for only a few frames has done the trick.

Also added a light in time with the sprite to illuminate an area.


Rook Zimbabwe(Posted 2005) [#7]
I hadn't thought about the light... nice idea!
-RZ