Animation vraiment basic de la main
This commit is contained in:
10
Player.gd
10
Player.gd
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user