1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-21 23:54:23 +00:00
hella-farm/behaviours/move.gd

22 lines
434 B
GDScript

@icon("res://behaviours/move.svg")
extends Node2D
class_name Move
signal move(norm: Vector2)
signal move_toggled(value: bool)
signal move_enabled
signal move_disabled
## Whether this component should emit [signal move].
@export var enabled: bool = true:
get:
return enabled
set(value):
if enabled != value:
enabled = value
move_toggled.emit(value)
if value:
move_enabled.emit()
else:
move_disabled.emit()