Post

 Resources 

Console


RE: I see now.. Jay Wheeler (0 replies, 0 views) (2000-Jul-5)
-
D00d, I know what you're trying to do! But listen to me. Even though your character is freeform, your map is tile-based. So whenever you want to do collision detection (every game loop, OR whenever your characters move), you need to convert your freeform coordinates to tile coordinates to see which tile your character is standing on. He might be on tile (3.5, 2.1) or tile (3.8, 2.4) or (3.2, 2.5) or whatever, but as far as your collision detection is concerned, he's still on tile (3, 2). And if he's walking left and tile (2,2) is "obstacle" (which you check by accessing your map array at (2, 2), then you can't allow your character to move there. In other words, once your player's converted coordinates reach (3.0, 2.x) you must impede any further movement to the left.


-
Up One Level | Back to Forum


Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.
There have been 256 visitors within the last 20 minutes
RSS News Feed