Hi there,
I’m new to Phaser 3. Just started learning it a few days ago. Now, I need your help to fix a little issue.
Basically, I’m trying to make a Radar Screen Animation. Most of its functionality is already done, but I’m unable to hide the overflowing triangle (Radar signal/light) inside the circle.
I tried a lot of techniques like using GameObject Triangle instead of Geom Triangle, Layer Mask, Physics overlap, Geom Intersects, getBounds() etc. without any success.
Here are 2 example codes I’ve written:-
Example 1
- Source Code: GitHub - trulyfurqan/phaser3-radar-animation: Phaser 3 Radar Animation
- Live Demo: https://trulyfurqan.github.io/phaser3-radar-animation/
-
Screenshot:
===
Example 2
- Source Code: GitHub - trulyfurqan/phaser3-radar-animation-2: Phaser 3 Radar Animation (Method # 2)
- Live Demo: https://trulyfurqan.github.io/phaser3-radar-animation-2/
-
Screenshot:
===
Example # 1 is almost done. We just need to hide the overflowing triangle. If it is fixed then we’re good to go.
Whereas, In example # 2, a lot of functionality is messed up. For example, the triangle is not detecting any overlap with enemy/friendly Radar signatures. Also, the triangle is not displaying/working correctly if we change the given Radar settings.
But, the only positive thing in example # 2 is that the overflowing triangle is hidden/masked appropriately. I want to achieve this thing in example # 1. But, I can’t do that because of the limitation of Geom Triangle
Please have a look at the source code and demo to better understand my problem. I’ve also added brief comments where the code is not working.
Thanks