User Tools

Site Tools


en:tutorials:animation:animation_walkthrough

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:tutorials:animation_walkthrough [2018/02/13 20:46 (6 years ago)] – ↷ Page moved from tutorials:animation_walkthrough to en:tutorials:animation_walkthrough iarwainen:tutorials:animation:animation_walkthrough [2020/08/20 04:57 (4 years ago)] (current) – ↷ Page moved from en:tutorials:animation_walkthrough to en:tutorials:animation:animation_walkthrough sausage
Line 8: Line 8:
 The sprite sheet that will be used throughout is below: The sprite sheet that will be used throughout is below:
  
-{{ :tutorials:chicken-animation-sheet.png?direct |}}+{{ tutorials:animation:chicken-animation-sheet.png?direct |}}
  
 There will be five animations defined from this sprite sheet which are divided as follows: There will be five animations defined from this sprite sheet which are divided as follows:
  
-{{ :tutorials:chicken-animation-cutups.png?direct |}}+{{ tutorials:animation:chicken-animation-cutups.png?direct |}}
  
 The four frames in the red region will be used as the SitDown and StandUp animations. The two frames in the blue region will be the Jump animation. Finally, the six frames in the yellow region is the Run animation. The four frames in the red region will be used as the SitDown and StandUp animations. The two frames in the blue region will be the Jump animation. Finally, the six frames in the yellow region is the Run animation.
Line 48: Line 48:
 Compile and run, and we should have a basic chicken on the screen: Compile and run, and we should have a basic chicken on the screen:
  
-{{ :tutorials:chicken-start.jpg?direct |}}+{{ tutorials:animation:chicken-start.jpg?direct |}}
  
  
Line 60: Line 60:
 AnimationSet = ChickenAnimationSet AnimationSet = ChickenAnimationSet
 </code> </code>
 +
 +<WRAP center round box tip 60%>
 +The optional ''Graphic'' property is only used to supply a default frame size for the animation frames. If you don't define this, the first frame from your animation will supply the frame size.
 +</WRAP>
 +
  
 Next, define the animation set, which is a very simple one: Next, define the animation set, which is a very simple one:
Line 90: Line 95:
 Re-run, and the chicken should be sitting down over and over: Re-run, and the chicken should be sitting down over and over:
  
-{{ :tutorials:chicken-sitting.gif?direct |}}+{{ tutorials:animation:chicken-sitting.gif?direct |}}
  
 ===== Adding More Animations ===== ===== Adding More Animations =====
Line 360: Line 365:
 <code c> <code c>
 void CheckInputs(){ void CheckInputs(){
- if (orxInput_GetValue("Run") == orxTRUE && orxInput_HasNewStatus("Run")){+ if (orxInput_HasBeenActivated("Run")){
  orxObject_SetTargetAnim(chicken, "RunAnim");  orxObject_SetTargetAnim(chicken, "RunAnim");
  }  }
-  + else if (orxInput_HasBeenDeactivated("Run")){
- if (orxInput_GetValue("Run") == orxFALSE && orxInput_HasNewStatus("Run")){+
  orxObject_SetTargetAnim(chicken, "IdleAnim");  orxObject_SetTargetAnim(chicken, "IdleAnim");
  }  }
Line 410: Line 414:
  
 <code c> <code c>
- if (orxInput_GetValue("Jump"== orxTRUE && orxInput_HasNewStatus("Jump") &&  orxInput_GetValue("Run"== orxTRUE){+ if (orxInput_HasBeenActivated("Jump") && orxInput_IsActive("Run")){
  orxObject_SetTargetAnim(chicken, "JumpAnim");  orxObject_SetTargetAnim(chicken, "JumpAnim");
  }  }
Line 488: Line 492:
 Here is another chicken, this one is blue with a nice red hat: Here is another chicken, this one is blue with a nice red hat:
  
-{{ :tutorials:chicken-animation-sheet-blue.png?direct |}}+{{ tutorials:animation:chicken-animation-sheet-blue.png?direct |}}
  
 Save this to your data folder as: chicken-animation-sheet-blue.png Save this to your data folder as: chicken-animation-sheet-blue.png
Line 523: Line 527:
 These two properties come in very handy when all the sprites are on the same sprite sheet. But having two separate sprite sheets avoided needing to use that. We'll cover these in another tutorial. These two properties come in very handy when all the sprites are on the same sprite sheet. But having two separate sprite sheets avoided needing to use that. We'll cover these in another tutorial.
  
-And now we're really done! I hope you enjoy using the animation system. Ask any questions on the forum, or come chat over at gitter.+And now we're really done! I hope you enjoy using the animation system. Ask any questions on the forum, or [[https://orx-project.org/discord|come chat over on discord]].
en/tutorials/animation/animation_walkthrough.1518583583.txt.gz · Last modified: 2018/02/14 00:46 (6 years ago) (external edit)