|
-
Senior Member
[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
92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!
-
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
Last edited by AnniHilatE; 10-23-2007 at 10:31 AM.
-
Senior Member
i didnt understand any of that, but thanks any way, ill keep it just in case i need it in the future
92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|