Yes I'm using the Pixelperfect test...and actually: No it doesn't eat too much
Well...At the moment I'm just testing 4 objects for collision but I'll see later if it's possible with 15 and more objects!
But I have mapscrolling...so if the test eats too much I'll just add something to only test the objects you can see at the moment.
To tracerouting:
I don't change the angle, because I have different animations that fit for each direction.
And just add this line to ensure, the enemy stops if he catched the player:
if(Player_X == Enemy_X && PlayerY == Enemy_Y)
return;
For avoiding objects just do something like:
Save the direction the sprite is moving,
Check if the enemy is colliding with any object.
(for exaple the sprite is colliding with an object and moved right-->)
Check if the player is higher or lower then the enemy. If the player is above move up, then right. If colliding move up again and then right. As long as you're not colliding anymore. Then you can go on normal movement
Hope you understand what I mean
[/code]