This repository has been archived on 2025-09-12. You can view files and clone it, but cannot push or open issues or pull requests.
ld48/level/CampMusicArea.gd
2021-04-27 02:49:19 +02:00

13 lines
460 B
GDScript

extends Area2D
func _ready() -> void:
connect("body_entered", self, "on_body_entered")
connect("body_exited", self, "on_body_exited")
func on_body_entered(body):
if body.has_method("update_selector"):
get_tree().get_root().find_node("Game", true, false).set_music_track(Game.MusicTrack.CAMP)
func on_body_exited(body):
if body.has_method("update_selector"):
get_tree().get_root().find_node("Game", true, false).set_music_track(Game.MusicTrack.EXPL)