A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Maybe someone here can help.

  1. #1
    Junior Member
    Join Date
    May 2008
    Posts
    2

    Maybe someone here can help.

    I've got my main character moving about and so on using Key.isDown

    No issues making her walk or crouch.

    Where I am running into difficulty is in getting her to do her combo when you push the A key.

    She has a jab, strong punch and a kick.

    I've figued out actionscript uses numbers for keys. Not sure how to make it read the key I want.

    I'd also like to make her jump, to play her jump animation to be specific, and to be able to move through the air while jumping. Then there is the jump attack. Looked into a tutorial on platform jumping, something I wanted in the game, it used action script 3.0 though. I'm still in Flash 8.

    I have been doing the Beat 'em tutorials on making Spllaterhouse, and tried to contact the man who made them. No dice.

    Maybe someone here can help.

    My code so far:

    sara.step=15;
    sara.attack = false;
    sara.stance= 1;
    sara.crouch=false;

    this.onEnterFrame = function()
    {
    if(sara.attack==false)
    {
    if (Key.isDown (Key.RIGHT) )
    {
    sara._xscale = 100;
    sara.stance=1;
    sara._x+=sara.step;
    sara.gotoAndStop("walk");
    }
    else if (Key.isDown (Key.LEFT) )
    {

    sara._xscale = -100;
    sara.stance=0;
    sara._x-=sara.step;
    sara.gotoAndStop("walk");
    }
    else if (Key.isDown (Key.DOWN) )
    {
    sara.gotoAndStop("crouch");
    sara.crouch=true;
    }
    else if (!Key.isDown () )
    {
    sara.gotoAndStop("stance");
    sara.crouch=false;

    }
    }
    }


    End Code

    Thank you in advance.

  2. #2
    Dukenuke Productions
    Join Date
    Oct 2005
    Location
    Over here
    Posts
    15
    For the numbers to all buttons: http://www.westech.us/raidenx/tutkeyboard.htm

    Just replace (Key.XX) with (##).

    For for example, to use z as a button it would be
    if(Key.isDown(90))

    I think it goes by the placement on the keyboard, so for a non-english layout it would still be the same buttons even if it's different letters on them. Not entirely sure though.

    As for jumping... can't help you with that, sorry.

  3. #3
    Junior Member
    Join Date
    May 2008
    Posts
    2
    Thank you Duke. I've tried using that system and it doesn't work for me. So I think I'm going to let this one go. Maybe hire someone to do the code later on. We'll see. Thank you for trying though.

  4. #4
    Musical chair sumwungye's Avatar
    Join Date
    Jan 2008
    Location
    Planet Earth, third planet from the Sun
    Posts
    287
    --SumWunGye

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