feat: started on dash action

This commit is contained in:
Sara Gerretsen 2026-06-23 11:21:30 +02:00
parent c98f1df881
commit 6efbca7c40
2 changed files with 28 additions and 1 deletions

View file

@ -221,6 +221,29 @@ func _process(_delta : float):
force_raycast_update()
"
[sub_resource type="GDScript" id="GDScript_exgcw"]
resource_name = "DashUpgrade"
script/source = "extends PlayerAction
var start_direction : Vector3
@export var speed : float
func _enter() -> int:
if Input.is_action_pressed(\"dash\") and not blackboard.move_input.is_zero_approx():
start_direction = blackboard.get_world_move_input()
return Running
return Fail
func _execute() -> int:
if status != Running:
return status
if not Input.is_action_pressed(\"dash\") or body.is_on_wall():
return Success
else:
body.velocity = start_direction * speed
return Running
"
[sub_resource type="GDScript" id="GDScript_3rerk"]
resource_name = "BelowLedgePrerequisite"
script/source = "extends PlayerAction
@ -499,6 +522,10 @@ character = NodePath("../PlayerModel")
[node name="ActionSelector" type="BehaviourSelector" parent="PlayerBehaviourTree/BehaviourRepeater" unique_id=433229675]
[node name="DashUpgrade" type="PlayerAction" parent="PlayerBehaviourTree/BehaviourRepeater/ActionSelector" unique_id=2076145534]
script = SubResource("GDScript_exgcw")
speed = 10.0
[node name="LedgeHangSequence" type="BehaviourSequence" parent="PlayerBehaviourTree/BehaviourRepeater/ActionSelector" unique_id=285489367]
[node name="CanLedgeHang" type="PlayerAction" parent="PlayerBehaviourTree/BehaviourRepeater/ActionSelector/LedgeHangSequence" unique_id=1704888964]

View file

@ -78,7 +78,7 @@ look_down={
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null)
]
}
run={
dash={
"deadzone": 0.2,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":5,"axis_value":1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194325,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)