2d sonar pulse?

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

Hello,

I am wondering if there is a way to make a “sonar-like” effect in a 2d game. For instance, if you are looking at the Flappy Bird demo game and the bird could send out a “pulse” that highlighted the edges of the pipes in front of it. I was hoping that this is something that could be done programatically instead of having to craftily weave together sprites in some cool way.

If anyone has any ideas, please pass them along!

Judd

:bust_in_silhouette: Reply From: genete

You can create a “sonar pulse” by a set of images and animate them inside a light mask. Of course, the objects to be discovered by the sonar pulse must have its corresponding light occluders.

I don’t think it could be done in a more programatically way

Could be interesting to combine this with raycasts, so you know where the sonar should stop/bounce and what to highlight.

Zylann | 2016-09-07 12:36