>RigidBody2D can report collisions (contact monitor need to be enabled and set to more than zero) and you can get them via signal (body_enter) or checking on fixed process/custom integrator (get_colliding_bodies).
gdscript
func _on_Player_body_entered(body):
print("player collided!")
$Camera2D._camera_shake()