Created
May 2, 2016 16:04
-
-
Save chadjemmett/28c0f4905f4c28062a90828b3434b71f 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
| #for ruby gosu | |
| def collision?(barrier_x, barrier_y) | |
| (barrier_x.between?(@x - 50, @x) and barrier_y.between?(@y, @y + 50)) || (barrier_x.between?(@x, @x + 50) && barrier_y.between?(@y - 50, @y)) || (barrier_x.between?(@x - 50, @x) && barrier_y.between?(@y - 50, @y)) || (barrier_x.between?(@x, @x + 50) && barrier_y.between?(@y, @y + 50)) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment