keys and doors working
This commit is contained in:
@@ -159,6 +159,7 @@ func _physics_process(delta):
|
||||
air_dash -= 1
|
||||
print("AIR DASH " +str(air_dash))
|
||||
|
||||
#walking
|
||||
if is_on_floor() and !is_climbing:
|
||||
if direction:
|
||||
velocity.x = lerp(velocity.x, direction.x * speed, delta * WALK_TRANSITION_SPEED)
|
||||
@@ -166,6 +167,7 @@ func _physics_process(delta):
|
||||
else:
|
||||
velocity.x = lerp(velocity.x, direction.x * speed, delta * 6.5) + (direction.x * DASH_SPEED)
|
||||
velocity.z = lerp(velocity.z, direction.z * speed, delta * 6.5) + (direction.z * DASH_SPEED)
|
||||
#ladder movement
|
||||
elif is_climbing:
|
||||
gravity = 0.0
|
||||
if direction:
|
||||
@@ -174,9 +176,10 @@ func _physics_process(delta):
|
||||
else:
|
||||
velocity.y = lerp(velocity.y, -direction.z * speed, delta * 6.5)
|
||||
velocity.x = lerp(velocity.x, direction.x * speed, delta * 6.5)
|
||||
#movement in air
|
||||
else:
|
||||
velocity.x = lerp(velocity.x, direction.x * speed, delta * 6.5)
|
||||
velocity.z = lerp(velocity.z, direction.z * speed, delta * 6.5)
|
||||
velocity.x = lerp(velocity.x, direction.x * speed, delta * 3)
|
||||
velocity.z = lerp(velocity.z, direction.z * speed, delta * 3)
|
||||
|
||||
# Head bob
|
||||
t_bob += delta * velocity.length() * float(is_on_floor())
|
||||
|
||||
Reference in New Issue
Block a user