A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Platformer - Rotating Arm 'HELP'

  1. #1
    Junior Member
    Join Date
    Aug 2009
    Posts
    2

    Post Platformer - Rotating Arm 'HELP'

    Here's the deal. I'm making side-scrolling platformer game using AS2.

    I've made a character that can walk and jump and all that, but I have one little problem.

    I want to make one of his arms (holding a gun) rotate at the shoulder so that it follows the mouse and you can aim it.

    I also want the the gun to shoot a bullet on a click of the left mouse button that travels in a straight line and dissapears off screen.

    Any idea's on how I would do this would be greatly appreciated.

  2. #2
    Senior Member
    Join Date
    Jun 2009
    Posts
    171
    One important tip:

    Create the upper-arm as one movie clip. Set its rotation point to the shoulder.

    Create the lower-arm as a separate movie clip. Set its rotation point to the elbow.

    By doing this, you can animate the arm in different positions and it will rotate properly. It also enables you to go back inside the arm and change the look, if needed, and it won't mess up the previous animations.

  3. #3
    Junior Member
    Join Date
    Aug 2009
    Posts
    2

    Wink

    Well thanks, thats a good idea actually seeing as how I was gonna do the whole arm as one piece originally, but the problem I'm still having is I don't know how to code the rotation and the bullet shot.

  4. #4
    Senior Member
    Join Date
    Jun 2009
    Posts
    171
    There's a lot of tutorials out there. I think the best thing to do is find one that works and customize it.

    I think you'll need the duplicateMovieClip() function and/or the attachMovieClip() for the bullet.

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