A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Hit Test or something else?

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    4

    Question Hit Test or something else?

    I have flash cs3
    im using actionscript 2
    the script im working with was originally written for flash 5

    im making my first real game. they always say the first is the toughest. i hope it gets easier the second time around.

    i used to use flash a lot as a pencil tester for traditional pencil/paper animations.

    i started messing with it making simple stuff like buttons, and i was really intrigued by it. I messed around with "art" based games just making the guy move and everything.

    The game im making now is a tile based game, a lot different than anything else i ever did in flash. i understand most of the codes and everything, but i dont think i'd be able to really write the codes from scratch just yet...

    but the thing im asking is how can i make it so when the character hits a certain tile, it goes to a new frame because i have about 3 levels on one frame, then i want an animated scene before the next few levels.

    in the art based games i would just do a hitTest, like this...

    onClipEvent (enterFrame) {
    if (this.hitTest(_root.char)) {
    this._parent.gotoAndPlay(2);
    }
    }

    on the movie clip. can i do something like this in a tile based game?
    i tried doing this itself, but it didnt work.
    so is there something else i can put that does the same thing?


    ohh and the code im using to get to the different levels on the same frame is pretty much a door, that brings it to a different map set on the same frame's code.

    i dont know if what im asking is really making any sense, but thanks for listening to my question at least.

  2. #2
    Junior Member
    Join Date
    Feb 2011
    Posts
    4
    ...any tips? ive really been at this all night.

  3. #3
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    What you have should/would work depending on your setup. What would have to happen for this to work is that the clip would have to hit another clip called char and then the parent would go to frame 2. But, if your instance names are wrong or the paths are incorrect then this won't work.

    So is there an object named char on the root? and is the parent of this caller actually the root that you're wanting to go to frame 2? That's about all I can suggest. I suppose you're either missing something or I'm not understanding. Maybe that helps? Explain some more about the setup and then I can probably help you better.
    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

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