A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: x and y velocity question positioning

Threaded View

  1. #1
    Senior Member
    Join Date
    Feb 2005
    Posts
    177

    x and y velocity question positioning

    in my game i started, all i have right now is a warrior (the main character).
    There are 4 movie elements right now, the warrior, sword, hand1, and hand2.

    i also have 2 keyboard elements controling the character and the sword's attack.

    ok, my element hand1 is my characters left hand and hand2 is his right.

    I am having trouble with the swords attack move (in my swordsattack keyboard element), where i am using this script when i press the space bar:

    element ("Sword").x=element ("hand2").x
    element ("Sword").y=element("hand2").y
    element("Sword").velocity.x=element("hand2").veloc ity.x
    element("Sword").velocity.y=element("hand2").veloc ity.y


    and when i am not pressing the space bar :

    element ("Sword").x=element ("hand1").x
    element ("Sword").y=element("hand1").y
    element("Sword").velocity.x=element("hand1").veloc ity.x
    element("Sword").velocity.y=element("hand1").veloc ity.y

    what i am trying to do, is when i am not pressing the space bar the sword is in my characters left hand, and when i am holding the space bar, the sword is in my characters right hand ready to attack villians comming at him.

    the problem is, is that when i hold space to switch the sword over to my characters right hand, it goes way to far out, its hard to explain but ill give my file so when u press play and press space to attack, u will see what i mean.

    if u find out a way i can get the swords closer to my characters hands, please tell me,

    thanks
    Attached Files Attached Files

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