Ledge grab tweaks
This commit is contained in:
parent
f833f1cec7
commit
d934c815e0
|
|
@ -1,5 +1,7 @@
|
||||||
extends Movement_StateReceiver
|
extends Movement_StateReceiver
|
||||||
|
|
||||||
|
export var debug_velocity_controller :bool = false
|
||||||
|
|
||||||
var parent_request_state_change :FuncRef
|
var parent_request_state_change :FuncRef
|
||||||
var parent_use_primary_item :FuncRef
|
var parent_use_primary_item :FuncRef
|
||||||
|
|
||||||
|
|
@ -11,7 +13,9 @@ onready var stamina_component = $"%Stamina_Component"
|
||||||
var state_stamina_cost :Dictionary
|
var state_stamina_cost :Dictionary
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
velocity_controller.debug = true
|
if debug_velocity_controller:
|
||||||
|
velocity_controller.debug = true
|
||||||
|
|
||||||
#var state_ref :State
|
#var state_ref :State
|
||||||
#var state_name :String
|
#var state_name :String
|
||||||
#state_name = 'jump'
|
#state_name = 'jump'
|
||||||
|
|
@ -326,6 +330,8 @@ func _state_process_physics_hurt():
|
||||||
|
|
||||||
func _state_process_physics_fall():
|
func _state_process_physics_fall():
|
||||||
flip_sprite_to_movement_direction()
|
flip_sprite_to_movement_direction()
|
||||||
|
var foo = $"%LedgeDetector".is_colliding()
|
||||||
|
var bar = $"%WallDetector".is_colliding()
|
||||||
|
|
||||||
if $"%LedgeDetector".is_colliding() and !$"%WallDetector".is_colliding():
|
if $"%LedgeDetector".is_colliding() and !$"%WallDetector".is_colliding():
|
||||||
#print("it touched me!")
|
#print("it touched me!")
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,7 @@ __meta__ = {
|
||||||
|
|
||||||
[node name="Movement_StateReceiver" parent="." index="2"]
|
[node name="Movement_StateReceiver" parent="." index="2"]
|
||||||
script = ExtResource( 6 )
|
script = ExtResource( 6 )
|
||||||
|
debug_velocity_controller = false
|
||||||
|
|
||||||
[node name="Modifier_Receiver" parent="." index="3" instance=ExtResource( 35 )]
|
[node name="Modifier_Receiver" parent="." index="3" instance=ExtResource( 35 )]
|
||||||
callable_state_machine = NodePath("../Movement_StateMachine")
|
callable_state_machine = NodePath("../Movement_StateMachine")
|
||||||
|
|
@ -132,14 +133,14 @@ debug_receiver = true
|
||||||
[node name="LedgeDetector" type="RayCast2D" parent="." index="4"]
|
[node name="LedgeDetector" type="RayCast2D" parent="." index="4"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
modulate = Color( 0, 1, 0, 1 )
|
modulate = Color( 0, 1, 0, 1 )
|
||||||
position = Vector2( 8, -10 )
|
position = Vector2( 6, -10 )
|
||||||
enabled = true
|
enabled = true
|
||||||
cast_to = Vector2( 1.36422e-12, -1 )
|
cast_to = Vector2( 4, -1 )
|
||||||
|
|
||||||
[node name="WallDetector" type="RayCast2D" parent="." index="5"]
|
[node name="WallDetector" type="RayCast2D" parent="." index="5"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
modulate = Color( 0, 1, 0, 1 )
|
modulate = Color( 0, 1, 0, 1 )
|
||||||
position = Vector2( 6, -16 )
|
position = Vector2( 6, -18 )
|
||||||
enabled = true
|
enabled = true
|
||||||
cast_to = Vector2( 4, 4 )
|
cast_to = Vector2( 4, 4 )
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user