A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Need help on character attacking

  1. #1
    Junior Member
    Join Date
    Oct 2008
    Posts
    3

    Need help on character attacking

    i need help making my character attack by using mouse left click

    it goes from char to right hand to then the attack tween. what is the code?


    what is the code for the enemy to attack u?

  2. #2
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    Can you provide an example, hard to understand what you're asking.
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  3. #3
    Junior Member
    Join Date
    Oct 2008
    Posts
    3
    Quote Originally Posted by samac1068
    Can you provide an example, hard to understand what you're asking.
    forget about the first one then its to confusing lol

    how do u make the enemy attack you?

    cuz i got the AI and hp part right.

  4. #4
    Junior Member
    Join Date
    Oct 2008
    Posts
    29
    What he is trying to say is... When there is Main Character. Then how do you make the character movieclip attack with the mouse clicking function and when the main character does a hitTest on the enemy movieclip. The enemy movieclip will have a certain frame in it that will show the enemy attacking.

    I used to know the code. Forgotten it

  5. #5
    Intermediate Game Dev pseudobot's Avatar
    Join Date
    May 2008
    Location
    New Zealand
    Posts
    561
    This is confusing....please post the *.fla so we can see what you have got so far...
    Needs an update...

  6. #6
    Junior Member
    Join Date
    Oct 2008
    Posts
    29
    You know those flash games like Hero RPG by Micheal Nuemann?
    Just google it It's like a top viewed game and you'll need to click with your mouse to attack. That's basically what Angel_Boi is trying to say

  7. #7
    Junior Member
    Join Date
    Oct 2008
    Posts
    29
    Quote Originally Posted by Angel_Boi
    i need help making my character attack by using mouse left click

    it goes from char to right hand to then the attack tween. what is the code?


    what is the code for the enemy to attack u?
    Okay I think I got the attacking code for your main charater attacking with a mouse click.

  8. #8
    Junior Member
    Join Date
    Oct 2008
    Posts
    29
    Code:
    onClipEvent(mousedown){
    _root.Character.Sword.gotoAndPlay(2);
    }
    Example. Please post if the code is wrong or it has case sensitive okay?

  9. #9
    Junior Member
    Join Date
    Oct 2008
    Posts
    29
    For the enemy attacking...
    It should be like...
    Code:
    onClipEvent(load){
    _root.enemy.hitTest(this){
    gotoAndPlay(2);
    }
    }
    Something like that. I haven't check =(
    I should though. Wait a little while

  10. #10
    Intermediate Game Dev pseudobot's Avatar
    Join Date
    May 2008
    Location
    New Zealand
    Posts
    561
    ^no...
    PHP Code:
    onClipEvent(enterFrame){
         if (
    _root.enemy.hitTest(this) == true) {
              
    this.gotoAndPlay(2);
         }

    Needs an update...

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