In development work of my new game I found out that I need a function like CollisionFree(); but different version,
Collision Free From Actor! I started working with it, and got it done! And the best thing is that it works just perfect!
Here is the code for function:
- Code: Select all
int collFree(int posX, int posY, char Name[50]) //colliding positions and the actor that we want to know if we are collision free from
{
int temp;' //return value
Actor * coll;
coll = getactor(posX, posY); //actor that is collided
temp = (strcmp(coll->name, Name) != 0); //compare the actors names
return temp; //return temp = collision free or not
}
As you see, the code is really easy one.
This will make the controlling of enemy actors a lot easier, won't it?
![Smile :)](http://game-editor.com/forum/images/smilies/icon_smile.gif)
And here's a demo for you!