ScratchData LogoScratchData
Back to littlebunny06's profile

AABB to AABB Collision 2D

LIlittlebunny06•Created May 30, 2021
AABB to AABB Collision 2D
50
27
435 views
View on Scratch

Instructions

WASD for movement, R to reset, and C to toggle collision response You can change some variables by editing them in the editor. Please tell me if you find any bugs :)

Description

NOTES: I'm just going to share this because why not :P Just me making quick and simple 2D collisions so I can extend them to 3D. I did not use any control blocks. This means no loops, if-then statements, wait until blocks, etc... Because of that, this project has a bit too many blocks lol Black arrows are surface normals which are based on player velocity. The orange arrow is a surface normal which is based off of the positions and dimensions of the bounding boxes. The orange arrow will turn green if it is aligned with a velocity-based normal, and it will turn magenta if the player is colliding with the medium. The magenta normal, which has a magnitude of one, is multiplied by the penetration depth, a scalar, of the hitboxes, to give a vector to push out the player. Feel free to ask for clarification :P CREDITS: @Kouzerumatsu/@Kouzone made this, and I guess I remade it with extra steps: https://www.desmos.com/calculator/rjwcoqpsv3

Project Details

Project ID538142847
CreatedMay 30, 2021
Last ModifiedJune 20, 2021
SharedJune 6, 2021
Visibilityvisible
CommentsAllowed