That's why I chose the pix function, I don't know how to create a collision involving line with math ;_;
Because of this post I tried to make a simple cart example of how to check this type of intersections, if you're interested you can check it here:
https://tic80.com/play?cart=2073