A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [CS3] need help hittest

  1. #1

    Angry [CS3] need help hittest

    i made my character for a game and i made walls which work here is the code

    onClipEvent (enterFrame) {
    if (_root.wall.hitTest(_x, _y, true)) {
    xspeed = 0;
    yspeed = 0;
    }

    but half of my character still goes through the wall before it acutally calls the code

    how do i stop this?

    please help

    thanks Hopies
    The one that smiles when things go wrong, Has thought of someone to blame it on

  2. #2
    Senior Member craziumdude's Avatar
    Join Date
    Sep 2005
    Location
    Fort Wayne, IN
    Posts
    109
    I usually use

    if (this.hitTest(_root.wall)){
    //do stuff
    }

    I find it a bit more efficient.

  3. #3
    now my character dont move at all should i add that the wall is one movieclip in the shape of a maze
    The one that smiles when things go wrong, Has thought of someone to blame it on

  4. #4
    can anyone HELP please thanks
    The one that smiles when things go wrong, Has thought of someone to blame it on

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