GZDoom tips: using layers
People seem to be enjoying the more technical GZDoom posts... So here's a GZDoom tip for weapon spriting: use layers!
My most layer-heavy weapon is probably the Rifle/Flamethrower from Painslayer: all of its main elements are separate graphics.
My most layer-heavy weapon is probably the Rifle/Flamethrower from Painslayer: all of its main elements are separate graphics.
I move and scale them independently, and the final result looks pretty volumetric.
The pilot light is also a series of sprite layers that are independently created, scaled down and moved up. They're also dynamically offset when the player moves the camera around:
Sprite layers are great for muzzle flashes and highlights (I would even say, a must). Each layer can have its own blending style, opacity, position and rotation.
It's great to randomize your flashes. And remember, muzzle flashes aren't glued to the barrel when it moves!
P.S. You can read more about sprite layers and how they're handled in weapons in the Weapons, overlays and PSprite chapter of my ZScript guide. (But I do recommend reading the whole thing from the beginning if you're new to ZScript)