Creating a pixel art laser.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ErkiElbrecht
:warning: Old Version Published before Godot 3 was released.

Hi,

I am creating a pixelart platformer and i have some cool attack mechanics in mind. The hardest one which i can’t seem to get working is a laser beam controlled by the mouse cursor. I have tried using path2d, but i quickly realised that i needed something to morph the image: Because i want to make it smooth and lasery like that:Here it looks curvy

(Cerdit goes to MSPaint)

I havent got any ideas how to do that so i am here for help.

Thanks in advace!

Not a pixel artist but maybe a shader based deformation could help.

There are some deformable polygons on the assetlib you can look at and Godot 3 will have a Line node, both should work fine with a tileable texture.

eons | 2017-06-14 17:08

Love the concept art. XD

avencherus | 2017-06-17 14:03

A simple concept art can end in a great product :smiley: https://twitter.com/josef_fares/status/873641612563185668

eons | 2017-06-17 14:34

:bust_in_silhouette: Reply From: Omicron

I would use some kind of buffer. Then use/send a smoothed version of values from it.

:bust_in_silhouette: Reply From: keke

Hmm, pixel art makes this hard - otherwise I would recommend using _draw. One thing you could do for straight lasers is make a cross section like so:

Then scale it in-engine so it looked like

Maybe for curved lasers you could stack a bunch of the cross sections, slightly offset?