Hi, I have programmed a fairly decent custom movement for the main character in my topdown action game. The collision detection worked just fine and did prevent my character from walking through walls (quick backdrops set to "obstacle"), but now when I added doors, it's all a mess.
I have four collision detectors that surround my character, and when one of them are overlapping a background object OR a door, a value is set to 1, and it's not possible to move in that direction. When the detector doesn't overlap anything, the value returns to 0, and you can once again move in that direction. But it doesn't work.
When it was obvious that something was wrong, I tried to track down the problem by adding ink effekt to the collision detectors which values are set to 1. This way I figured out that they don't alwasy return to 0 even though they aren't overlapping anything. Sometimes they do, but perhaps 50% of the times, they don't. I can't imagine why!
Like I said, it worked when I didn't have any doors. =/
Any ideas of what I might have missed?
How would you usually solve this kind of stuff? If you just could assign an obstacle type to active objects this would be so much easier. The way it is now you have to include every single active non-passable object in your code. Or am I missing something clever here?
Thanks in advance