Now About Social Code
summaryrefslogtreecommitdiff
path: root/scripts/player.gd
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/player.gd')
-rw-r--r--scripts/player.gd5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/player.gd b/scripts/player.gd
index f0886ef..73490d3 100644
--- a/scripts/player.gd
+++ b/scripts/player.gd
@@ -108,7 +108,6 @@ func _physics_process(delta):
if valid_climb and stamina > 0:
last_wall_direction = get_wall_normal()
climbing = true
- stam_consumption += RUN_CONSUMPTION
elif climbing:
climbing = false
@@ -126,11 +125,13 @@ func _physics_process(delta):
# As good practice, you should replace UI actions with custom gameplay actions.
var input_dir = Input.get_vector("left", "right", "backward", "forward")
var direction = (input_dir.y * fwd + input_dir.x * right).normalized()
- var climb_direction = (input_dir.y * climb_direction_fwd + input_dir.x * climb_direction_right).normalized()
+ var climb_direction: Vector3 = (input_dir.y * climb_direction_fwd + input_dir.x * climb_direction_right).normalized()
if climbing:
#print("Climb direction is ", climb_direction_fwd, " ", climb_direction_right, " ", get_wall_normal())
velocity = climb_direction * speed
velocity += -speed * last_wall_direction
+ if input_dir.length_squared() > 0:
+ stam_consumption += RUN_CONSUMPTION
#print("Velocity is ", velocity)
elif direction:
velocity.x = direction.x * speed