Hello!
im making a top down game.
the player is a kinematic body 2d that auto moves continually forward, you just rotate the direction. this works perfect, but i want that the player bounces forward (as in the image attached) when it collides with the tilemap world

this is the player movement code:
extends KinematicBody2D
var rotation_speed = 3
var rotation_dir = 0
var direction = 1
var speed = 50
var velocity = Vector2()
func _physics_process(delta):
rotation += rotation_dir * rotation_speed * delta
velocity = Vector2(speed, 0).rotated(rotation) * direction
velocity = move_and_slide(velocity)
i've tried changing the last line with moveandcollide (times delta) but it doestn work. on a collision with the world, the player just gets stuck.
thank you very much!