Looking For A Method


Imerion

Member
Joined
Feb 24, 2005
Messages
218
Do you know any good method of doing collision-detection in adventure style games, where you have a fixed background and a character moving on it. Sort of like "Day of the Tentacle" or "Kings Quest"? I need to limit the area where the character should be able to walk. Its a bit hard to explain. I was thinking of a few methods, for example using points and then measure the distance between the character and the points and if it gets to close, you won't be able to move further in that direction. I also thought of using an invisible object marking the area where the character should not be able to go, so I can check collision between this object and the character. But neither of these seem very practical. Anyone who has some more ideas?
 
Back when I started fiddling with fenix, I read a nice way somewhere to do collision detection. You simply load another bitmap and set it's z-level so it can't be seen at any time. On this bitmap there will only be two colors. One marks the space where you can move and the other marks where the character can't go. Then you make a loop which constantly checks if the character sprite touches any pixels that are of the non walkable color (compare the coordinates)... not sure how it would look as code since I haven't done anything in fenix for like 3 years (DIV back then...). I think sort of the same method is used in castle of dr. malvado...
 
Back when I started fiddling with fenix, I read a nice way somewhere to do collision detection. You simply load another bitmap and set it's z-level so it can't be seen at any time. On this bitmap there will only be two colors. One marks the space where you can move and the other marks where the character can't go. Then you make a loop which constantly checks if the character sprite touches any pixels that are of the non walkable color (compare the coordinates)... not sure how it would look as code since I haven't done anything in fenix for like 3 years (DIV back then...). I think sort of the same method is used in castle of dr. malvado...

Theres a better way to do that, but thats basically the idea, or you could use normal process collision detection, or "box" detection, where you mark the coordinates, but this doesn't sound like it is what you need.
 
Last edited by a moderator:
Back when I started fiddling with fenix, I read a nice way somewhere to do collision detection. You simply load another bitmap and set it's z-level so it can't be seen at any time. On this bitmap there will only be two colors. One marks the space where you can move and the other marks where the character can't go. Then you make a loop which constantly checks if the character sprite touches any pixels that are of the non walkable color (compare the coordinates)... not sure how it would look as code since I haven't done anything in fenix for like 3 years (DIV back then...). I think sort of the same method is used in castle of dr. malvado...

Actually, I tried this method and it works fine. I guess its quite a slow method, but since its an adventure/rpg game there won't be much onscreen action anyway so it should work fine.
 
Back
Top