|
|
|
@ -11,8 +11,8 @@ func _process(delta):
|
|
|
|
if Global.is_level_loading_contorl:return
|
|
|
|
if Global.is_level_loading_contorl:return
|
|
|
|
if status.is_pause:return
|
|
|
|
if status.is_pause:return
|
|
|
|
var is_hit_floor = update_on_floor(delta)
|
|
|
|
var is_hit_floor = update_on_floor(delta)
|
|
|
|
update_speed_y(delta)
|
|
|
|
|
|
|
|
update_move(delta)
|
|
|
|
update_move(delta)
|
|
|
|
|
|
|
|
update_speed_y(delta)
|
|
|
|
character.move_and_slide()
|
|
|
|
character.move_and_slide()
|
|
|
|
if character.velocity:
|
|
|
|
if character.velocity:
|
|
|
|
SignalManager.character_pos_changed.emit(character.id(),character.pos())
|
|
|
|
SignalManager.character_pos_changed.emit(character.id(),character.pos())
|
|
|
|
@ -31,11 +31,15 @@ func update_on_floor(delta) -> bool:
|
|
|
|
|
|
|
|
|
|
|
|
func update_speed_y(delta):
|
|
|
|
func update_speed_y(delta):
|
|
|
|
var has_y_speed = status.skill_float_speed != 0 or status.hit_up_speed != 0
|
|
|
|
var has_y_speed = status.skill_float_speed != 0 or status.hit_up_speed != 0
|
|
|
|
|
|
|
|
var is_on_stair = character.is_on_stair()
|
|
|
|
if has_y_speed:
|
|
|
|
if has_y_speed:
|
|
|
|
character.velocity.y = status.skill_float_speed + status.hit_up_speed
|
|
|
|
character.velocity.y = status.skill_float_speed + status.hit_up_speed
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
if not status.is_on_floor:
|
|
|
|
if is_on_stair:
|
|
|
|
character.velocity.y -= gravity * delta * status.cfg.move.gravity_scale
|
|
|
|
character.velocity.y = status.cfg.move.speed * 0.75
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
if not status.is_on_floor:
|
|
|
|
|
|
|
|
character.velocity.y -= gravity * delta * status.cfg.move.gravity_scale
|
|
|
|
status.speed_y = character.velocity.y
|
|
|
|
status.speed_y = character.velocity.y
|
|
|
|
|
|
|
|
|
|
|
|
func update_move(delta):
|
|
|
|
func update_move(delta):
|
|
|
|
|