A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: hitTest Question

  1. #1
    Member
    Join Date
    Dec 2003
    Location
    Colorado
    Posts
    94

    hitTest Question

    I am trying to make an RPG game. I have everything laid out and know what I'm going to do, but right now I'm just testing the actionscript before I throw everything together. I have a hitTest code to enter new "rooms" that looks like this:

    onClipEvent (enterFrame) {
    if(this.hitTest(_root.ball)){
    _root.gotoAndStop("1");
    }
    }

    I have this on 4 sides of the screen to start. If I were to go to the bottom screen, then come back up, the hit test would go to frame 1, but then automatically go to frame 2, because there is a hitTest there. How can I make it so that the character can completely enter a room before the hitTest would work again?
    Attached Files Attached Files
    When it comes to believing in god, I relaly tried
    -George Carlin
    I guess heartbreak's a fire, and I got burned
    -Home Grown

  2. #2
    Glacier
    Join Date
    Dec 2004
    Location
    glacier
    Posts
    18
    would you give your room map to me to understand your game
    or you can create a new parameter to judge where should gotoAndPlay

  3. #3
    Member
    Join Date
    Dec 2003
    Location
    Colorado
    Posts
    94
    It's just a test right now. The first, starting square is in the middle, surrounded by a square on each side. The top is square 2, to the left is square 3, the bottom is square 4, and the right is square 5.
    When it comes to believing in god, I relaly tried
    -George Carlin
    I guess heartbreak's a fire, and I got burned
    -Home Grown

  4. #4
    Glacier
    Join Date
    Dec 2004
    Location
    glacier
    Posts
    18
    i have try my best but it only be a little better.
    The file which had been modified is here
    Attached Files Attached Files

  5. #5
    Member
    Join Date
    Dec 2003
    Location
    Colorado
    Posts
    94
    That did help a little bit...I tried messing with the x and y coordinates upon a hitTest, but the sides still don't work. Does anyone else have any suggestions?
    When it comes to believing in god, I relaly tried
    -George Carlin
    I guess heartbreak's a fire, and I got burned
    -Home Grown

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