ft: nucleotide prey FSM

This commit is contained in:
2026-01-26 23:54:15 +01:00
parent c11afd9ddd
commit adf1438bc8
18 changed files with 121 additions and 45 deletions

View File

@@ -0,0 +1,19 @@
extends State
@onready var timer = $Timer
func enter(previous_state_path: String, data := {}) -> void:
timer.start((float)(randi() % 5)/5)
func physics_update(_delta: float) -> void:
owner.move(Vector3(randfn(0, 1), randfn(0, 1), 0))
func _on_timer_timeout() -> void:
if (randi() % 4 != 0):
finished.emit(owner.fsm.States.RANDOMMOVEMENT, {})
else:
finished.emit(owner.fsm.States.IDLE, {})
func exit() -> void:
timer.stop()