allow crushing very slightly earlier after uncrushing

This commit is contained in:
2026-02-08 12:39:02 -03:00
parent 1497a225cc
commit 7632358b90
2 changed files with 43 additions and 9 deletions

View File

@@ -42,13 +42,13 @@ func _physics_process(_delta: float) -> void:
if _tutorial_step != TutorialStep.DONE:
match _tutorial_step:
TutorialStep.PRESS_J:
if _crusher_is_active:
if crusher_is_active:
_tutorial_step = (_tutorial_step + 1) as TutorialStep
else:
_press_d_prompt.hide()
_press_j_prompt.show()
TutorialStep.PRESS_D:
if not _crusher_is_active:
if not crusher_is_active:
_tutorial_step = (_tutorial_step + 1) as TutorialStep
else:
_press_d_prompt.show()
@@ -81,25 +81,23 @@ func _on_ghost_spawn_timer_timeout() -> void:
@export var _splat_sfx: AudioStreamPlayer3D
@export var _crusher_anim: AnimationPlayer
# can't reactivate until deactivated, and vice versa
@export var crusher_is_active := false
@onready var _crush_range_start = _crusher.position.y + 1.8
@onready var _crush_range_end = _crusher.position.y + -1.4
# can't reactivate until deactivated, and vice versa
var _crusher_is_active := false
func _crusher_activate() -> void:
if _crusher_anim.is_playing() or _crusher_is_active:
if crusher_is_active:
return
_crusher_is_active = true
_crusher_anim.play("crush")
func _crusher_deactivate() -> void:
if _crusher_anim.is_playing() or not _crusher_is_active:
if not crusher_is_active:
return
_crusher_is_active = false
_crusher_anim.play("uncrush")
func crusher_crush() -> void:

View File

@@ -267,6 +267,18 @@ tracks/5/keys = {
"update": 0,
"values": [Vector3(1, 1, 1)]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("..:crusher_is_active")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_s6lek"]
resource_name = "crush"
@@ -348,6 +360,18 @@ tracks/5/keys = {
"times": PackedFloat32Array(0)
}
tracks/5/use_blend = true
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("..:crusher_is_active")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="Animation" id="Animation_kgj8g"]
resource_name = "idle"
@@ -409,6 +433,18 @@ tracks/2/keys = {
"times": PackedFloat32Array(0)
}
tracks/2/use_blend = true
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("..:crusher_is_active")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0.13333334),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_kgj8g"]
_data = {