pollen-not-included/entities/scripts/beehive.gd
Dan 2a9e78b52e Refactor: Added explicit typing and void return types
- 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.
2024-05-15 10:42:16 +01:00

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