Skip to content

lsvekis/JavaScript-DOM-Collision-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

JavaScript-DOM-Collision-Detection

Coding Example from YouTube Video How to detect overlap between two page elements

X-Horizontal check formula : (a.x < (b.x + b.width)) && ((a.x + a.width) > b.x);

y-Vertical check formula : (a.y < (b.y+b.height)) && ((a.y + a.height) > b.y);

Moving the boxes

Box 1 Red - Moves with Arrow keys Box 2 Blue - Moves with A,W,S,Z keys

Move the boxes, check for overlap

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages