+1 vote

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!

in Engine by (20 points)

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.

Love the concept art. XD

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

2 Answers

0 votes

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

by (338 points)
0 votes

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?

by (146 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.