szatomi

New mechanics!

I added two new mechanincs to the game, along with some polishing on the softbody.

Double jump

The player can now double-jump, with various indicators showing how many jumps they have left. If the player has already double-jumped (leaving them with 0 jumps), the character leaves a smoke trail behind, and their eyes close.



player.gd
func double_jump(delta : float) -> void:

    setFreeze(true)
    await get_tree().create_timer(0.04).timeout
    setFreeze(false)
    
    if dead: return
    
    eyes.close()
    
    for i in range(size):
        points[i].linear_velocity.y = jump_force * delta * 100

No-gravity zones

As the name suggests, no-gravity zones feature zero gravity, allowing players to move in all four directions! These zones are easily distinguishable from regular tiles by their white, dashed outlines.



Extended movement script:

player.gd
func move(dir : float, vertical_dir : float, delta : float):
    
    if dead or finish_pos: return

    for point in points:
        
        if dir and !is_dashing:
            point.linear_velocity.x += dir * acceleration * delta
            point.linear_velocity.x = clamp(point.linear_velocity.x, -speed, speed)
        
        if vertical_dir and no_gravity and !is_dashing:
            point.linear_velocity.y += vertical_dir * acceleration * delta
            point.linear_velocity.y = clamp(point.linear_velocity.y, -speed, speed)

        elif is_dashing:
            point.linear_velocity.x += dir * acceleration * delta * 20
            point.linear_velocity.x = clamp(point.linear_velocity.x, -speed * 3, speed * 3)
            stop_dash()
    
        else:
            point.linear_velocity.x = move_toward(point.linear_velocity.x, 0, delta * friction)
            if no_gravity:
                point.linear_velocity.y = move_toward(point.linear_velocity.y, 0, delta * friction)