Hello and welcome to our community! Is this your first visit?
Register
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Regular Member
    Join Date
    Apr 2008
    Location
    Australia
    Posts
    187

    Action Scripting

    well i need to know how to make a punching bag animation play when my guy is in range and has a fully extended punch (collision detection)

    here's what i have so-far

    http://www.animationshed.org/mygames/

    walk is the arrow keys and punch is space bar

    i've looked for tutorials but couldn't find any one's that could resolve this.


    help is greatly appreciated.

  2. #2
    Insanity Skype's Avatar



    Join Date
    Apr 2007
    Location
    England
    Posts
    27,397

    Re: Action Scripting

    Just have the punchbag mc play when he collides (when you press space), having collision detection as precise as that is stupid really.

    There are plenty of tutorials for this.

  3. #3
    Regular Member
    Join Date
    Apr 2008
    Location
    Australia
    Posts
    187

    Re: Action Scripting

    i understand what i have to do, there's no point telling me what i already know.

    could someone give me a link to a good tutorial then?

  4. #4
    Insanity Skype's Avatar



    Join Date
    Apr 2007
    Location
    England
    Posts
    27,397

    Re: Action Scripting

    www.google.com <-- best tutorial search engine ever!

    www.tutorialized.com

    www.pixel2life.com

  5. #5
    Veteran Enthusiast LeadingManNigel's Avatar


    Join Date
    May 2005
    Location
    New York City
    Posts
    6,213

    Re: Action Scripting

    http://www.newgrounds.com/bbs/topic/229808/43

    Has loads of great tutorials by awesome scripters.

  6. #6
    Obsessed Veteran Adam's Avatar



    Join Date
    Nov 2004
    Location
    UK / England
    Posts
    17,271

    Re: Action Scripting

    Two options;

    Bounding boxes, or per pixel collision detection.

    I'd strongly advise bounding boxes for your task, the latter is much harder. A player must have a recentagle, and the bag. Then just check whether they intersect.

  7. #7
    Regular Member
    Join Date
    Apr 2008
    Location
    Australia
    Posts
    187

    Re: Action Scripting

    ok, thanks guys, i'll look around them.

    @adam: that pixel collision detection sounds interesting, i'll look it up and find out more about it, thanks.

  8. #8
    Regular Member
    Join Date
    Apr 2008
    Location
    Australia
    Posts
    187

    Re: Action Scripting

    sorry for the double post

    here's the code that i have so-far

    Code:
    onClipEvent(enterFrame){
    if(this.hitTest(this._parent.man.Punch)){
    gotoAndPlay(this.Punched);
    }else{
                this.gotoAndStop(1);
            }
        }
    can you tell me what errors there are?

  9. #9
    ☄ (。・ω・。) ☄ Peebles's Avatar

    Join Date
    Jun 2008
    Location
    Michigan
    Posts
    4,948

    Re: Action Scripting

    Click the check button when you enter the action script coding to see if there are any errors.

  10. #10
    Regular Member
    Join Date
    Apr 2008
    Location
    Australia
    Posts
    187

    Re: Action Scripting

    i already did, and it came up none, but it doesn't work, that's why i'm not asking computers, i'm asking people.


 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •