1
Fork 0
mirror of https://github.com/Steffo99/pineapple-surf.git synced 2024-11-25 09:14:18 +00:00
pineapple-surf/island/Sea.gd

18 lines
412 B
GDScript3
Raw Normal View History

2023-01-08 22:13:46 +00:00
extends Node3D
signal splashed(splasher: CanSplash)
func splash(splasher: CanSplash):
var splash_sound = splasher.get_node("SplashSound")
splash_sound.play()
splasher.emit_signal("splashed")
emit_signal("splashed", splasher)
func _on_splash_area_body_entered(body: Node3D):
var splashers: Array[Node] = body.find_children("*", "CanSplash", false, false)
for splasher in splashers:
splash(splasher)