improve and update ai
This commit was merged in pull request #32.
This commit is contained in:
18
core/ai/framework/run_state.gd
Normal file
18
core/ai/framework/run_state.gd
Normal file
@@ -0,0 +1,18 @@
|
||||
extends State
|
||||
|
||||
var starting_speed: float
|
||||
|
||||
func enter() -> void:
|
||||
super.enter()
|
||||
run_animation()
|
||||
agent.navigate_to_random_point()
|
||||
starting_speed = agent.speed
|
||||
agent.speed = agent.speed * 1.5
|
||||
|
||||
func physics_update(_delta) -> void:
|
||||
if agent.nav_agent.is_navigation_finished():
|
||||
transitioned.emit(self, get_next_state())
|
||||
|
||||
func exit() -> void:
|
||||
agent.speed = starting_speed
|
||||
super.exit()
|
||||
Reference in New Issue
Block a user