Added rain with terrain collision

This commit is contained in:
ChaoticByte 2024-09-26 20:10:56 +02:00
parent 471c496003
commit 335a082dae
No known key found for this signature in database
4 changed files with 38 additions and 6 deletions

View file

@ -1,10 +1,14 @@
[gd_scene load_steps=2 format=3 uid="uid://cbynoofsjcl45"]
[gd_scene load_steps=3 format=3 uid="uid://cbynoofsjcl45"]
[ext_resource type="Script" path="res://core/dynamic_polygon.gd" id="1_2pai0"]
[sub_resource type="OccluderPolygon2D" id="OccluderPolygon2D_fkh4m"]
[node name="DynamicPolygon" type="CollisionPolygon2D"]
script = ExtResource("1_2pai0")
update = null
[node name="Polygon2D" type="Polygon2D" parent="."]
color = Color(0, 0, 0, 1)
[node name="LightOccluder2D" type="LightOccluder2D" parent="."]
editor_description = "For particle collisions"
occluder = SubResource("OccluderPolygon2D_fkh4m")

View file

@ -13,8 +13,13 @@ extends CollisionPolygon2D
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()