Spatial 2D sound w/ reverb, first attempt

This commit is contained in:
ChaoticByte 2024-10-05 09:50:03 +02:00
parent 7833a1c756
commit 3ec5a9edf7
No known key found for this signature in database
17 changed files with 192 additions and 13 deletions

25
core/polygon/polygon.gd Normal file
View file

@ -0,0 +1,25 @@
@tool
extends CollisionPolygon2D
@export var color: Color = Color.WHITE:
set(v):
color = v
update_polygon()
get():
return color
@export var update: bool:
set(v):
update_polygon()
func update_polygon():
# normal polygon
$Polygon2D.polygon = polygon
$Polygon2D.color = color
# light occluder
var lo_polygon = OccluderPolygon2D.new()
lo_polygon.polygon = polygon
$LightOccluder2D.occluder = lo_polygon
func _ready() -> void:
update_polygon()