SLAP!
This commit is contained in:
parent
d54d58c736
commit
da7860f05f
26
Player.gd
26
Player.gd
@ -115,6 +115,20 @@ func _physics_process(delta):
|
||||
else:
|
||||
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 slap >= slapkill:
|
||||
@ -126,18 +140,6 @@ func _physics_process(delta):
|
||||
hitbox.slap_level = slap
|
||||
hitbox.slap_kill = slapkill
|
||||
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()
|
||||
|
||||
|
13
Player.tscn
13
Player.tscn
@ -69,6 +69,7 @@ tracks/2/keys = {
|
||||
|
||||
[sub_resource type="Animation" id=6]
|
||||
resource_name = "basic_slap"
|
||||
length = 3.0
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Head/HandParent/Hand:translation")
|
||||
tracks/0/interp = 1
|
||||
@ -76,10 +77,10 @@ tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 1 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"times": PoolRealArray( 0, 1, 2, 3 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1 ),
|
||||
"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/path = NodePath("Head/HandParent/Hand:rotation_degrees")
|
||||
@ -88,10 +89,10 @@ tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 0, 1 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"times": PoolRealArray( 0, 1, 2, 3 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1 ),
|
||||
"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"]
|
||||
|
Loading…
Reference in New Issue
Block a user