This commit is contained in:
MarcEricMartel 2022-10-12 08:38:28 -04:00
parent d54d58c736
commit da7860f05f
2 changed files with 21 additions and 18 deletions

View File

@ -115,6 +115,20 @@ func _physics_process(delta):
else: else:
isSlap = false; isSlap = false;
if (chargeSlap):
slap += delta * 1.5;
else:
slap -= delta * 8.0;
slap = clamp(slap, 0.0, 1.0)
slap_gauge.fill = slap
if !isSlap and can_slap:
slap_animator.seek(slap, true)
if isSlap:
slap_animator.playback_speed = 20
slap_animator.play()
slap_gauge.fill = slap;
slap_gauge.kill = slapkill;
if isSlap: if isSlap:
if slap >= slapkill: if slap >= slapkill:
@ -127,18 +141,6 @@ func _physics_process(delta):
hitbox.slap_kill = slapkill hitbox.slap_kill = slapkill
hitbox.slap_vector = point_to.get_global_transform().origin - camera.get_global_transform().origin hitbox.slap_vector = point_to.get_global_transform().origin - camera.get_global_transform().origin
if (chargeSlap):
slap += delta * 1.5;
else:
slap -= delta * 8.0;
slap = clamp(slap, 0.0, 1.0)
slap_gauge.fill = slap
slap_animator.seek(slap, true)
slap_gauge.fill = slap;
slap_gauge.kill = slapkill;
direction = direction.normalized() direction = direction.normalized()
if isStep: if isStep:

View File

@ -69,6 +69,7 @@ tracks/2/keys = {
[sub_resource type="Animation" id=6] [sub_resource type="Animation" id=6]
resource_name = "basic_slap" resource_name = "basic_slap"
length = 3.0
tracks/0/type = "value" tracks/0/type = "value"
tracks/0/path = NodePath("Head/HandParent/Hand:translation") tracks/0/path = NodePath("Head/HandParent/Hand:translation")
tracks/0/interp = 1 tracks/0/interp = 1
@ -76,10 +77,10 @@ tracks/0/loop_wrap = true
tracks/0/imported = false tracks/0/imported = false
tracks/0/enabled = true tracks/0/enabled = true
tracks/0/keys = { tracks/0/keys = {
"times": PoolRealArray( 0, 1 ), "times": PoolRealArray( 0, 1, 2, 3 ),
"transitions": PoolRealArray( 1, 1 ), "transitions": PoolRealArray( 1, 1, 1, 1 ),
"update": 0, "update": 0,
"values": [ Vector3( 0, 0, 0 ), Vector3( -0.103, 2.756, 0 ) ] "values": [ Vector3( 0, 0, 0 ), Vector3( -0.103, 2.756, 0 ), Vector3( -2, -5, 0 ), Vector3( 0, 0, 0 ) ]
} }
tracks/1/type = "value" tracks/1/type = "value"
tracks/1/path = NodePath("Head/HandParent/Hand:rotation_degrees") tracks/1/path = NodePath("Head/HandParent/Hand:rotation_degrees")
@ -88,10 +89,10 @@ tracks/1/loop_wrap = true
tracks/1/imported = false tracks/1/imported = false
tracks/1/enabled = true tracks/1/enabled = true
tracks/1/keys = { tracks/1/keys = {
"times": PoolRealArray( 0, 1 ), "times": PoolRealArray( 0, 1, 2, 3 ),
"transitions": PoolRealArray( 1, 1 ), "transitions": PoolRealArray( 1, 1, 1, 1 ),
"update": 0, "update": 0,
"values": [ Vector3( 0, 0, 0 ), Vector3( -36.146, -1.281, 0 ) ] "values": [ Vector3( 0, 0, 0 ), Vector3( -36.146, -1.281, 0 ), Vector3( 90.146, -1.281, 0 ), Vector3( 0, 0, 0 ) ]
} }
[node name="Player" type="KinematicBody"] [node name="Player" type="KinematicBody"]