A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [help] hitTest help

  1. #1
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874

    [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!

  2. #2
    Member
    Join Date
    Sep 2005
    Posts
    33
    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.

  3. #3
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center