Animation vraiment basic de la main

This commit is contained in:
Victor Turgeon
2022-10-11 14:58:23 -04:00
parent dce110a9b3
commit 172eb8acbd
4 changed files with 103 additions and 20 deletions

View File

@@ -23,10 +23,12 @@ var gravity_vec = Vector3()
onready var head = $Head
onready var ground_check = $GroundCheck
onready var SlapGauge = $HUD/ActualHUD/SlapGauge
onready var slap_gauge = $HUD/ActualHUD/SlapGauge
onready var slap_animator = $HandMovement
func _ready():
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
slap_animator.current_animation = "basic_slap"
func _input(event):
if event is InputEventMouseMotion:
@@ -82,8 +84,9 @@ func _physics_process(delta):
else:
slap -= delta * 8.0;
slap = clamp(slap, 0.0, 1.0)
SlapGauge.fill = slap;
slap_gauge.fill = slap
slap_animator.seek(slap, true)
direction = direction.normalized()
h_velocity = h_velocity.linear_interpolate(direction * speed, h_acceleration * delta)
@@ -91,4 +94,7 @@ func _physics_process(delta):
movement.x = h_velocity.x + gravity_vec.x
movement.y = gravity_vec.y
# warning-ignore:return_value_discarded
move_and_slide(movement, Vector3.UP)