ScratchData LogoScratchData
Back to Java_Programmer's profile

More Collision Detection

JAJava_Programmer•Created June 13, 2018
More Collision Detection
53
46
671 views
View on Scratch

Instructions

Press space to switch the shape following your mouse. Try moving the shape near the circles and rectangles! I'm cheating a little for circle v. rectangle collisions, but otherwise, these collisions use the Separating Axis Theorem. Basically, if you can find a line that separates the two shapes, they aren't colliding. If you can't, they are colliding. In 2D, the separating line is always perpendicular to a normal vector of one of the shapes.

Description

Heyoooo, I put in all the formulas for rectangle v. rectangle collisions and it worked correctly the first time. These two sources have been incredibly helpful so far: http://www.metanetsoftware.com/technique/tutorialA.html http://www.jkh.me/files/tutorials/Separating%20Axis%20Theorem%20for%20Oriented%20Bounding%20Boxes.pdf

Project Details

Project ID228956429
CreatedJune 13, 2018
Last ModifiedJune 13, 2018
SharedJune 13, 2018
Visibilityvisible
CommentsAllowed