06-25-2004, 08:44 PM
i read several posts regarding collission detection and what not. i saw a few which suggested to place a "mask" in a different color of the borders or objects and use the point function with the coordinates of the character to determine if they can or cannot go there. Then overlay this mask with the real map. i didn't want to use this exact method but something similiar.
Instead, i'm using a 2D array that has either a 1 or 0. 1 is a impassable, 0 is fine. This method works quite nicely the only issue is this. Since my array is the size of the screen (320, 200) i have to use the /ah method in order for the game to load up. Will this be a problem to run if i make an exe?
Also about the collission, i've thought about making a "type" of map that x, y, object, and passable are its properties. Then just check the character coords against the map.passable and be done. The problem with that is that some of the objects aren't a perfect square and the player can move around a little within the square. This "type" method seems to only work with a perfect square object. Would it be possible to use the map type and have not perfect squares?
The method i currently use would handle the uneven borders because my "object mask" of 1s and 0s is pixel based whereas the "map type" method is tile based. Thanks for your time and i hope this all makes sense.
Instead, i'm using a 2D array that has either a 1 or 0. 1 is a impassable, 0 is fine. This method works quite nicely the only issue is this. Since my array is the size of the screen (320, 200) i have to use the /ah method in order for the game to load up. Will this be a problem to run if i make an exe?
Also about the collission, i've thought about making a "type" of map that x, y, object, and passable are its properties. Then just check the character coords against the map.passable and be done. The problem with that is that some of the objects aren't a perfect square and the player can move around a little within the square. This "type" method seems to only work with a perfect square object. Would it be possible to use the map type and have not perfect squares?
The method i currently use would handle the uneven borders because my "object mask" of 1s and 0s is pixel based whereas the "map type" method is tile based. Thanks for your time and i hope this all makes sense.