Hi,
We’re currently working on an Art-based RPG in Flash. We managed to get the character moving very well, but he doesn’t detect the limits. We looked at many forums for hitTest and collisions but don’t understand how it works and where they get the numbers they put in their code. And many tutorials only show the hitTest method wich uses the bounding boxes of the MC… but our limits are irregular, not squares.
If you want to help, look at our .fla file so you can take a look and tell us how to fix this problem. The filesize is too big for this forum… but it’s only 267kb… for those interested I’ll send it to you.
Some codes are located in a button called “animation” wich tell the character to walk facing a certain direction.
But I think we need to put our hitTest codes in the character’s MC (heroMC)at the same place we tell him to walk 10 pixels in a specific direction depending on wich key has been pressed. OR maybe the code goes in the first frame. OR directly on the limit MC.
perhaps something like this but I don’t understand how it works…
if (_root.limitMC.hitTest(this._x+[color=navy]something[/color], this._y+[color=navy]something[/color], true)) {
this._x += [color=navy]something[/color];
this._y += [color=navy]something[/color];
}
Thank you very much!