ft (Wip): FSM behaviour prey
This commit is contained in:
17
evolve-die-repeat/molecular/nucleotide_prey_foraging.gd
Normal file
17
evolve-die-repeat/molecular/nucleotide_prey_foraging.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
extends NucleotidePreyState
|
||||
|
||||
@onready var timer = $Timer
|
||||
var dir: float = 0.0
|
||||
|
||||
func enter(previous_state_path: String, data := {}) -> void:
|
||||
timer.start(randi() % 5)
|
||||
dir = randi() % 360
|
||||
|
||||
func physics_update(_delta: float) -> void:
|
||||
# TODO: move in direction of dir
|
||||
pass
|
||||
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
dir = randi() % 360
|
||||
timer.start(randi() % 5)
|
||||
Reference in New Issue
Block a user