|
|
|
|
@ -28,19 +28,16 @@ func update_gravity(delta):
|
|
|
|
|
status.speed_y = character.velocity.y
|
|
|
|
|
|
|
|
|
|
func update_move():
|
|
|
|
|
var input_dir = status.move_dir
|
|
|
|
|
var direction = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
|
|
|
|
|
var speed = status.cfg.move.speed
|
|
|
|
|
if direction:
|
|
|
|
|
character.velocity.x = direction.x * speed
|
|
|
|
|
character.velocity.z = direction.z * speed
|
|
|
|
|
else:
|
|
|
|
|
character.velocity.x = move_toward(character.velocity.x, 0, speed)
|
|
|
|
|
character.velocity.z = move_toward(character.velocity.z, 0, speed)
|
|
|
|
|
var move_speed = status.cfg.move.speed * (1 + status.speed_up_rate)
|
|
|
|
|
var move_velocity = status.move_dir * move_speed
|
|
|
|
|
var skill_velocity = status.skill_dir * status.skill_move_speed
|
|
|
|
|
move_velocity += skill_velocity
|
|
|
|
|
character.velocity.x = move_velocity.x
|
|
|
|
|
character.velocity.z = move_velocity.y
|
|
|
|
|
|
|
|
|
|
status.speed_xz = Vector2(character.velocity.x,character.velocity.z).length()
|
|
|
|
|
if status.is_free_turn and direction.x != 0:
|
|
|
|
|
status.is_right = direction.x > 0
|
|
|
|
|
if status.is_free_turn and move_velocity.x != 0:
|
|
|
|
|
status.is_right = move_velocity.x > 0
|
|
|
|
|
|
|
|
|
|
func jump():
|
|
|
|
|
character.velocity.y = status.cfg.move.jump_velocity
|
|
|
|
|
|