Last active
January 18, 2016 18:11
-
-
Save joshblack/0a2efd519a16f0dfdece to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Given two item objects with the following shape: | |
* | |
* { | |
* x: number, | |
* y: number, | |
* width: number, | |
* height: number | |
* } | |
* | |
* where (x, y) denotes the position of the item's top-left corner | |
* with respect to the top left area of the screen, and width and | |
* height correspond to the dimensions of the item, | |
* | |
* Write a function, `collides`, that takes in two items and returns a | |
* boolean indicating if the two items overlap. | |
*/ | |
/** | |
* Determine if two items overlap | |
* | |
* @param {Item} l1 | |
* @param {Item} l2 | |
* @return {boolean} | |
*/ | |
function collides(l1, l2) { | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment