A Flash Developer Resource Site

Results 1 to 17 of 17

Thread: [HELP] Player attack combination?

  1. #1
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    86

    Question [HELP] Player attack combination?

    Hello guys, any idea to make a "combo" attack to a player? Exemple: the player press in this order: key A, key A, key A, and the every click the person execute the animation relative of the number of the combo (relative key pressed).

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi,

    You don't ask for much Crazy, you might or probably will find something along that theme inside the tutorials section of flashkit.
    It might also help if you attached somkething already started. obviously you need some listeners for the keys and some vars to add up.

  3. #3
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,089
    Hi, try this for getting the random fight frame between 1-20:

    function randomFightFrame(a,b){
    while(1!=b*a){
    for(var i=0;i<100;i++){
    trace("generated fight frame " + i);
    }
    }
    }
    randomFightFrame(1,20)
    I was born with a camera in my eyeball maybe

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi,

    Not sure what you are doing Alloy, that just gives the dreaded

    "A script in this movie is causing flash to run slowly" window

    and then all it does is trace

    generated fight frame 0
    generated fight frame 1
    generated fight frame ...
    generated fight frame ...
    generated fight frame 60
    generated fight frame 61

    and so on until it realises it will loop continuously.

    The guy is asking for key press sequences

  5. #5
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi,

    You should be looking more into something like so.

    Tags still not working on here
    Last edited by fruitbeard; 11-21-2016 at 05:32 AM.

  6. #6
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,089
    If you had some projects open running that could have caused some crying :S
    I was born with a camera in my eyeball maybe

  7. #7
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi,

    Not really Alloy, just makes flash go a little unresponsive for a few seconds.

    Are you trying to help the thread creator or not?

  8. #8
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    86
    fruitbeard, If you're already professional in actionscript 2, it's your problem. Guy, I'm not forcing you to answer my post, if I ask because I have not found it on some other site, I do not want to be ignorant, I'm just giving a direct answer.

  9. #9
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    HI,

    Thanks Crazy, I actually am helping you, it's the other guy that tried to give you stupid code.

    However it would help if you showed a little effort in the first place of what you have achieved.

    I remember giving you some help with some other posts and you are little over easy on the thanks, I suggest you read the trhead from the beginning

  10. #10
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    86
    Hey guy, sorry, I did not understand correctly, your code is nice, sorry for the misunderstanding...
    .

  11. #11
    Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    1,089
    Any strings help build a thread, any thread help build the flashkit rope
    I was born with a camera in my eyeball maybe

  12. #12
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi,

    Helping people with their problem makes them come back and also helps improve theirs and your capabilities.
    Will you be helping Crazy in his quest or just giving profound statements, of which you could start your own thread and keep the rope nice and thick.

  13. #13
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    86
    Ok fruitbeard, thanks more one time.. I am testing the code, if any questions arise I will ask one more time.

  14. #14
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    86
    Sorry for the spam, I getting a little problem. I added in the player in first frame, gray color, in second, red, in third, green and in fourth, blue. When the player execute the combo, he back to the first frame, but when this occurs, the guy jump the four frame (blue color) of the attack animation, I hope you understood. I need fix this.

    There's something that needs to be improved in the code?
    Attached Files Attached Files

  15. #15
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi,

    mess with this.
    I think you need to have a stop(); on each frame of the animation thimngy ma bob.

    what happened to the tank thing
    Last edited by fruitbeard; 11-24-2016 at 04:37 AM.

  16. #16
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    86
    Bro, I test it, the player execute the animations correctly, but, I have some problems. How to block the key down? For example, every click of A key the player execute one animation, dont hold to execute animation. When the guy click one time, the person dont back to the first frame. It's possible to add a time for each atack? Because of the time it takes to execute each attack animation.

    About the tank, see in the tank post.

  17. #17
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi,

    The code to do what you ask is within the code provided earlier, mess around with it.

Tags for this Thread

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