User Tag List

Results 1 to 2 of 2

Thread: Link Turning Animation by Dummy Tile Modifier (Anima) [FFC]

  1. #1
    Cor Blimey! CJC's Avatar
    Join Date
    Dec 2002
    Location
    Fading into the darkness
    Age
    35
    Posts
    1,398
    Mentioned
    150 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,621
    Level
    25
    vBActivity - Bars
    Lv. Percent
    1.44%

    Link Turning Animation by Dummy Tile Modifier (Anima) [FFC]

    Successor expressed interested in the script I used to impose turning sprites on Link. However, he declared distaste about the Tile Modifier aspect of the script, preferring DrawTile in its place. Still, I'm sure somebody can modify this into something worth using.

    Code:
    ffc script DiagonalAnima{
    
    	void run(){
    		int TurnGrade;
    		const int PosSlopeAnima = 16; //Sets the number for the dummy item
    		//that makes Link animate for up-right and down-left.
    		//Don't bother changing the slash and action tiles, though,
    		//just the walking ones.
    		//Set as Bait for testing
    		const int NegSlopeAnima = 12; //Sets the number for the dummy item
    		//that makes Link animate for down-right and up-left.
    		//Set as Letter for testing
    	
    		while(true){
    			if(Link->Dir == 0){ //Facing Up
    				if(Link->InputRight || Link->InputDown){
    					Link->InputRight = false; Link->InputDown = false;
    					TurnGrade++; //Makes the turn more gradual, so you can actually see it.
    					if(!Link->Item[PosSlopeAnima]){ Link->Item[PosSlopeAnima] = true;}
    					//Adds the Positive Slope Anima.  At this point, Link will
    					//appear to be facing north by north-east.
    					if(Link->Item[NegSlopeAnima]){ Link->Item[NegSlopeAnima] = false;}
    					//Removes the Negative Slope Anima.  This is to prevent the player
    					//from owning both at the same time, which they can achieve by
    					//mashing the keyboard.  The result of owning both is a big ugly mess.
    					if(TurnGrade >= 6){
    						Link->Dir = 3;
    						//Sets Link's official direction to Right.  He'll still appear
    						//to be turning at this point, but the turn will be east by north-east
    						//instead.
    						TurnGrade = 5;
    					}
    				}
    				if(Link->InputLeft){
    					Link->InputLeft = false;
    					TurnGrade--; //Same as above, but in the opposite direction.
    					//At this point, Link would be facing north by north-west.
    					if(!Link->Item[NegSlopeAnima]){ Link->Item[NegSlopeAnima] = true;}
    					if(Link->Item[PosSlopeAnima]){ Link->Item[PosSlopeAnima] = false;}
    					if(TurnGrade <= -6){
    						Link->Dir = 2;
    						//Sets Link's official direction to Left.  He will appear
    						//to be facing west by north-west.
    						TurnGrade = -5;
    					}
    				}
    				if(TurnGrade > 0 && Link->InputUp){
    					Link->InputUp = false;
    					TurnGrade--;
    					//Used to revert back to neutral if you decide to
    					//press up again after the turn right begins.
    				}
    				if(TurnGrade < 0 && Link->InputUp){
    					Link->InputUp = false;
    					TurnGrade++;
    					//Used to revert back to neutral if you  decide to
    					//press up again after the turn left begins.
    				}
    				if(TurnGrade == 0 && (Link->Item[PosSlopeAnima] || Link->Item[NegSlopeAnima])){
    					Link->Item[PosSlopeAnima] =  false;
    					Link->Item[NegSlopeAnima] = false;
    					//Removes the Anima if you are facing the cardinal
    					//direction... in this case, north.
    				}
    			}
    			if(Link->Dir == 1){ //Facing Down
    				if(Link->InputRight){
    					Link->InputRight = false;
    					TurnGrade--;
    					if(!Link->Item[NegSlopeAnima]){ Link->Item[NegSlopeAnima] = true;}
    					if(Link->Item[PosSlopeAnima]){ Link->Item[PosSlopeAnima] = false;}
    					if(TurnGrade <= -6){
    						Link->Dir = 3;
    						TurnGrade = -5;
    					}
    				}
    				if(Link->InputLeft || Link->InputUp){
    					Link->InputLeft = false; Link->InputUp = false;
    					TurnGrade++;
    					if(!Link->Item[PosSlopeAnima]){ Link->Item[PosSlopeAnima] = true;}
    					if(Link->Item[NegSlopeAnima]){ Link->Item[NegSlopeAnima] = false;}
    					if(TurnGrade >= 6){
    						Link->Dir = 2;
    						TurnGrade = 5;
    					}
    				}
    				if(TurnGrade > 0 && Link->InputDown){
    					Link->InputDown = false;
    					TurnGrade--;
    				}
    				if(TurnGrade < 0 && Link->InputDown){
    					Link->InputDown = false;
    					TurnGrade++;
    				}
    				if(TurnGrade == 0 && (Link->Item[PosSlopeAnima] || Link->Item[NegSlopeAnima])){
    						Link->Item[PosSlopeAnima] =  false;
    						Link->Item[NegSlopeAnima] = false;
    					}
    				}
    			if(Link->Dir == 2){ //Facing Left
    				if(Link->InputUp || Link->InputRight){
    					Link->InputUp = false; Link->InputRight = false;
    					TurnGrade--;
    					if(!Link->Item[NegSlopeAnima]){ Link->Item[NegSlopeAnima] = true;}
    					if(Link->Item[PosSlopeAnima]){ Link->Item[PosSlopeAnima] = false;}
    					if(TurnGrade <= -6){
    						Link->Dir = 0;
    						TurnGrade = -5;
    					}
    				}
    				if(Link->InputDown){
    					Link->InputDown = false;
    					TurnGrade++;
    					if(!Link->Item[PosSlopeAnima]){ Link->Item[PosSlopeAnima] = true;}
    					if(Link->Item[NegSlopeAnima]){ Link->Item[NegSlopeAnima] = false;}
    					if(TurnGrade >= 6){
    						Link->Dir = 1;
    						TurnGrade = 5;
    					}
    				}
    				if(TurnGrade > 0 && Link->InputLeft){
    					Link->InputLeft = false;
    					TurnGrade--;
    				}
    				if(TurnGrade < 0 && Link->InputLeft){
    					Link->InputLeft = false;
    					TurnGrade++;
    				}
    				if(TurnGrade == 0 && (Link->Item[PosSlopeAnima] || Link->Item[NegSlopeAnima])){
    					Link->Item[PosSlopeAnima] =  false;
    					Link->Item[NegSlopeAnima] = false;
    				}
    			}
    			if(Link->Dir == 3){ //Facing Right
    				if(Link->InputUp){
    					Link->InputUp = false;
    					TurnGrade++;
    					if(!Link->Item[PosSlopeAnima]){ Link->Item[PosSlopeAnima] = true;}
    					if(Link->Item[NegSlopeAnima]){ Link->Item[NegSlopeAnima] = false;}
    					if(TurnGrade >= 6){
    						Link->Dir = 0;
    						TurnGrade = 5;
    					}
    				}
    				if(Link->InputDown || Link->InputLeft){
    					Link->InputDown = false; Link->InputLeft = false;
    					TurnGrade--;
    					if(!Link->Item[NegSlopeAnima]){ Link->Item[NegSlopeAnima] = true;}
    					if(Link->Item[PosSlopeAnima]){ Link->Item[PosSlopeAnima] = false;}
    					if(TurnGrade <= -6){
    						Link->Dir = 1;
    						TurnGrade = -5;
    					}
    				}
    				if(TurnGrade > 0 && Link->InputRight){
    					Link->InputRight = false;
    					TurnGrade--;
    				}
    				if(TurnGrade < 0 && Link->InputRight){
    					Link->InputLeft = false;
    					TurnGrade++;
    				}
    				if(TurnGrade == 0 && (Link->Item[PosSlopeAnima] || Link->Item[NegSlopeAnima])){
    					Link->Item[PosSlopeAnima] =  false;
    					Link->Item[NegSlopeAnima] = false;
    				}
    			}
    			Waitframe();
    		} // end of while loop
    	} // end of void run
    }
    I know there is probably a better way to code this, but that's not the point of this thread. Also, this is provided as-is, so you're going to have to play with it if you want to use it (I had never intended to share it outside my quest, but since that quest will likely never be finished, you can poke the dead remains of its script).
    I'm an author. If you're interested in checking out my works, you can find them on Amazon.com:


  2. #2
    Username Kaiser SUCCESSOR's Avatar
    Join Date
    Jul 2000
    Location
    Winning.
    Age
    37
    Posts
    4,436
    Mentioned
    152 Post(s)
    Tagged
    7 Thread(s)
    vBActivity - Stats
    Points
    10,563
    Level
    30
    vBActivity - Bars
    Lv. Percent
    52.07%
    I was actually interested in the sprites but it is a very interesting script. I'll have to look at it more closely soon. My distaste for using LTMs is that using them when unnecessary can cause problems when you use LTMs for many things inwhich they are necessary. And LTMs tend to give me a headache in general.

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