diff options
Diffstat (limited to 'godot/scenes/environment/Water.gd')
| -rw-r--r-- | godot/scenes/environment/Water.gd | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/godot/scenes/environment/Water.gd b/godot/scenes/environment/Water.gd new file mode 100644 index 0000000..6fd4dc2 --- /dev/null +++ b/godot/scenes/environment/Water.gd @@ -0,0 +1,13 @@ +extends Spatial + + +func create_splash(pos, size): + var splash = preload("res://particles/WaterSplash.tscn").instance() + get_parent().add_child(splash) + splash.global_transform.origin = pos + splash.scale = size*Vector3.ONE + +func _on_WaterArea_body_entered(body): + if body.has_method("extinguish"): body.extinguish() + #print(body.get_aabb().get_area()) + create_splash(body.global_transform.origin, 1.5) |
