Created
January 14, 2011 23:23
-
-
Save maryrosecook/780484 to your computer and use it in GitHub Desktop.
This file contains 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
// Make a structure to hold all the grid squares | |
For each grid square | |
Make a grid square container | |
// Put all the objects in the right grid square container | |
For each object in the world | |
Get the object's x and y coordinates | |
Determine which grid square the coordinate falls into | |
Add the object to that grid square container | |
// Get all the objects that a certain object is colliding with | |
Get the object's grid square | |
Return all the other objects in that grid square |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment