ScratchData LogoScratchData
Back to Java_Programmer's profile

Vector Line Collision

JAJava_Programmer•Created September 27, 2017
Vector Line Collision
59
41
732 views
View on Scratch

Description

Click and drag the two ends to move the points. Play around with it for a bit! :) I now made it so that the dot collides with the line, just like what you would see in a pen platformer. I'm not sure how the speed and physics would compare to a slope-based algorithm, so I may try it out some time. The benefit of this "algorithm" is that it's fast and simple. There may be a lot of multiplying, adding, and subtracting, but the only costly function is one sqrt. That's it! Here's a desmos link explaining how this works (outdated): https://www.desmos.com/calculator/skxqsbo1y9

Project Details

Project ID176885200
CreatedSeptember 27, 2017
Last ModifiedOctober 8, 2017
SharedSeptember 27, 2017
Visibilityvisible
CommentsAllowed