Add wait action to enemy
This commit is contained in:
parent
1aed988149
commit
02026ab3e9
13 changed files with 236 additions and 15 deletions
8
scripts/can_wait_condition.gd
Normal file
8
scripts/can_wait_condition.gd
Normal file
|
@ -0,0 +1,8 @@
|
|||
class_name CanWaitCodition
|
||||
extends ConditionLeaf
|
||||
|
||||
func tick(_actor, _blackboard):
|
||||
var num = randi_range(0, 1)
|
||||
if num == 0:
|
||||
return SUCCESS
|
||||
return FAILURE
|
|
@ -1,4 +1,4 @@
|
|||
class_name GetRandomTopCell
|
||||
class_name GetRandomTopCellAction
|
||||
extends ActionLeaf
|
||||
|
||||
func tick(actor, _blackboard):
|
|
@ -1,5 +1,5 @@
|
|||
class_name IsIdleCondition
|
||||
extends ConditionLeaf
|
||||
|
||||
func tick(actor, _blackboard):
|
||||
func tick(_actor, _blackboard):
|
||||
return SUCCESS
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
class_name MoveToTargetAction
|
||||
extends ActionLeaf
|
||||
|
||||
func before_run(actor, blackboard):
|
||||
func before_run(actor, _blackboard):
|
||||
actor.animation_player.play("walk")
|
||||
|
||||
func tick(actor, _blackboard):
|
||||
|
@ -12,5 +12,5 @@ func tick(actor, _blackboard):
|
|||
return SUCCESS
|
||||
return RUNNING
|
||||
|
||||
func after_run(actor, blackboard):
|
||||
func after_run(actor, _blackboard):
|
||||
actor.animation_player.stop()
|
||||
|
|
8
scripts/wait_action.gd
Normal file
8
scripts/wait_action.gd
Normal file
|
@ -0,0 +1,8 @@
|
|||
class_name WaitAction
|
||||
extends ActionLeaf
|
||||
|
||||
func before_run(actor, _blackboard):
|
||||
actor.animation_player.play("idle")
|
||||
|
||||
func tick(actor, blackboard):
|
||||
return RUNNING
|
Loading…
Add table
Add a link
Reference in a new issue