-
[help] hitTest help
how can i stop my mc falling into the area i have my hitTest??
here is the necesarey code:
Code:
//Gravity
onClipEvent (enterFrame) {
gravity++;
if (gravity>10) {
gravity--;
}
_y += gravity;
}
//hitTest (level)
onClipEvent (enterFrame) {
if (_root.level.hitTest(this._x+12.5, this._y+12.5, true)) {
gravity = 0;
this._y -= 1;
}
}
my hero MC is 25 x 25 pixels
-
im not gonna say how to do it, BUT
here is a nifty flash file i found on flashkit...
look for code to the walls, dont worry about inventory n stuff.
i think it should work, but it might not for you.
give it a go anyways
if that dont work, sum1 else might be able to help a little more than i can :rolleyes:
-
i didnt understand any of that, but thanks any way, ill keep it just in case i need it in the future