User Tag List

Results 1 to 5 of 5

Thread: Hadoken

  1. #1
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,434
    Level
    24
    vBActivity - Bars
    Lv. Percent
    70.35%

    Hadoken

    Down, down-forward, forward, A. But you knew that already, right?
    Demo
    Demo (alternate location)
    Should work as is in build 884+. Change fireball->Step=200; to fireball->Step=2; for older builds.

    Code:
    import "std.zh"
    const int SFX_HADOKEN=60;
    const int HADOKEN_TILE_LEFT=300;
    const int HADOKEN_TILE_RIGHT=302;
    const int HADOKEN_CSET=7;
    
    ffc script Hadoken
    {
        void run()
        {
            int step=0;
            int counter=0;
            int direction;
            bool stillHoldingA=false;
            
            while(true)
            {
                // Step 0: Wait for down to be pressed
                if(step==0)
                {
                    if(Link->InputDown && !(Link->InputUp || Link->InputLeft || Link->InputRight || Link->InputA))
                    {
                        step=1;
                        counter=0;
                    }
                }
                // Step 1: Wait for left or right to be pressed in addition to down
                else if(step==1)
                {
                    // If down isn't still held, or if another button is pressed, reset.
                    // Left and right are okay, as long as it's just one of them.
                    if(!Link->InputDown || Link->InputUp || Link->InputA || (Link->InputLeft && Link->InputRight))
                        step=0;
                    // Down is still held; check for left
                    else if(Link->InputLeft)
                    {
                        step=2;
                        counter=0;
                        direction=DIR_LEFT;
                    }
                    // Check for right
                    else if(Link->InputRight)
                    {
                        step=2;
                        counter=0;
                        direction=DIR_RIGHT;
                    }
                    // Nothing new, keep waiting
                    else
                    {
                        counter++;
                        // Waited too long, reset.
                        if(counter>10)
                            step=0;
                    }
                }
                // Step 2: Wait for down to be released
                else if(step==2)
                {
                    // Restart if an invalid button is pressed
                    if(Link->InputUp || Link->InputA || (Link->InputLeft && direction!=DIR_LEFT) || (Link->InputRight && direction!=DIR_RIGHT))
                        step=0;
                    // Move on if down isn't still being held
                    else if(!Link->InputDown)
                    {
                        step=3;
                        counter=0;
                    }
                    // Still held, keep waiting
                    else
                    {
                        counter++;
                        // Enough waiting.
                        if(counter>10)
                            step=0;
                    }
                }
                // Step 3: Wait for A to be pressed
                else
                {
                    // Restart if an invalid button is pressed, or if left or right aren't held anymore
                    if(Link->InputDown || Link->InputUp || !(Link->InputLeft || Link->InputRight) ||
                       (Link->InputLeft && direction!=DIR_LEFT) || (Link->InputRight && direction!=DIR_RIGHT))
                        step=0;
                    // Pressed A yet? 
                    else if(Link->InputA)
                    {
                        // Finally!
                        DoHadoken(direction);
                        stillHoldingA=true;
                        step=0;
                    }
                    // Nope. Just wait.
                    else
                    {
                        counter++;
                        // Too late.
                        if(counter>10)
                            step=0;
                    }
                }
                
                // Without this, Link'll use his sword afterward if A is held.
                if(stillHoldingA)
                {
                    if(Link->InputA)
                        Link->InputA=false;
                    else
                        stillHoldingA=false;
                }
                Waitframe();
            }
        }
        
        void DoHadoken(int direction)
        {
        
            Game->PlaySound(SFX_HADOKEN);    
            Link->Action=LA_ATTACKING;
    
            lweapon fireball=Screen->CreateLWeapon(LW_SCRIPT1);
            
            if(direction==DIR_LEFT)
            {
                fireball->OriginalTile=HADOKEN_TILE_LEFT;
                fireball->X=Link->X-8;
            }
            else
            {
                fireball->OriginalTile=HADOKEN_TILE_RIGHT;
                fireball->X=Link->X+8;
            }
            fireball->Y=Link->Y;
            fireball->CSet=HADOKEN_CSET;
            fireball->NumFrames=2;
            fireball->Dir=direction;
            fireball->Step=200;
            fireball->Damage=8;
        }
    }

  2. #2
    Octorok
    Join Date
    Jan 2008
    Age
    32
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    941
    Level
    10
    vBActivity - Bars
    Lv. Percent
    64.59%

    Re: Hadoken

    lol

    It doesn't seems to hurt much the boss though...

  3. #3
    Keese
    Join Date
    Mar 2005
    Location
    Portugal
    Age
    37
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    823
    Level
    10
    vBActivity - Bars
    Lv. Percent
    4.34%

    Re: Hadoken

    Quote Originally Posted by lucas92 View Post
    lol

    It doesn't seems to hurt much the boss though...
    You have to jump and hadoken the head it's the only way! lol

    Great script!


  4. #4
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,960
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.39%

    Re: Hadoken

    This makes me want to shape-change into something small and furry so I can hump your leg Saffith.


    PS: Link+Hurricane Kick+Sound Effect = Certified Gold. XD


    ...And now we have yet another reason why a update needs to be done on the control scheme of Zelda Classic.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  5. #5
    Octorok
    Join Date
    Jan 2008
    Age
    32
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    941
    Level
    10
    vBActivity - Bars
    Lv. Percent
    64.59%

    Re: Hadoken

    Why didn't you put the sound anyway? :p

    You just proved that fighting games are possible with Zelda Classic lol.
    Just kidding.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social