Thanks for the reply.
Even though I didnt read the tutorial I think I did somewhat what the person did in that tutorial.
I just constantly check the units coordinates against the collision map. If the pixel I am standing on (on the collision map, has a color (getPixel result value) larger than 0, then I am on unwalkable terrain. Walks like a charm!
Having a bit of problem now with my AI though, can't really collision detect the same way. It still works, it just sometimes cowers and runs back to its original position (which it should do when it doesnt have a "scent" on the player unit and the player unit is out of range/out of sight.
But still, the collision map/pixel test really did the job for me, perfect wall-collision detection for my player unit.
|