Might need help with code for my Sonic Engine

I’m not rly too experienced with Godot that much, but I can try to remake Sonic physics, if I even have the time. can ya help me turn sum of this base code into something that resembles Sonic physics?

extends CharacterBody2D

@export var speed = 1200
@export var jump_speed = -1800
@export var gravity = 4000
@export_range(0.0, 1.0) var friction = 0.1
@export_range(0.0 , 1.0) var acceleration = 0.25


func _physics_process(delta):
    velocity.y += gravity * delta
    var dir = Input.get_axis("walk_left", "walk_right")
    if dir != 0:
        velocity.x = lerp(velocity.x, dir * speed, acceleration)
    else:
        velocity.x = lerp(velocity.x, 0.0, friction)

    move_and_slide()
    if Input.is_action_just_pressed("jump") and is_on_floor():
        velocity.y = jump_speed

if you can, plzz let me know, thx

It would be better to use move_toward (with a much higher acceleration) instead of lerp, but other than that recommendation I’m not sure you’ve explain what makes something resemble sonic physics. Is there anything you are particularly dissatisfied with? What happens in game and what do you expect to happen? How do those two questions line up?

Alright i’ll get on that right away, but mainly I was asking how I can add Sonic styled terrain collision, air speed, loop-de-loops, rolling homing attack, and spindash