- Introduced explicit typing to variables and functions across multiple scripts for better code clarity. - Specified 'void' as the return type for functions that do not return a value. - Removed redundant code in some scripts.
20 lines
453 B
GDScript
20 lines
453 B
GDScript
extends Node2D
|
|
class_name Beehive
|
|
|
|
var dancer_in_range : bool = false
|
|
|
|
@onready var outline : Sprite2D = $AreaHighlight
|
|
|
|
func show_outline() -> void:
|
|
outline.visible = true
|
|
|
|
func hide_outline() -> void:
|
|
outline.visible = false
|
|
|
|
func _on_area_2d_area_entered(area : Area2D) -> void:
|
|
if area.is_in_group("dancer"):
|
|
dancer_in_range = true
|
|
|
|
func _on_area_2d_area_exited(area : Area2D) -> void:
|
|
if area.is_in_group("dancer"):
|
|
dancer_in_range = false
|