This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext 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 iarwain | en: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: | + | {{ tutorials:animation: |
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: | + | {{ tutorials: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. | 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: | + | {{ tutorials:animation: |
Line 60: | Line 60: | ||
AnimationSet = ChickenAnimationSet | AnimationSet = ChickenAnimationSet | ||
</ | </ | ||
+ | |||
+ | <WRAP center round box tip 60%> | ||
+ | The optional '' | ||
+ | </ | ||
+ | |||
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: | + | {{ tutorials:animation: |
===== Adding More Animations ===== | ===== Adding More Animations ===== | ||
Line 360: | Line 365: | ||
<code c> | <code c> | ||
void CheckInputs(){ | void CheckInputs(){ | ||
- | if (orxInput_GetValue(" | + | if (orxInput_HasBeenActivated(" |
orxObject_SetTargetAnim(chicken, | orxObject_SetTargetAnim(chicken, | ||
} | } | ||
- | + | else if (orxInput_HasBeenDeactivated(" | |
- | if (orxInput_GetValue(" | + | |
orxObject_SetTargetAnim(chicken, | orxObject_SetTargetAnim(chicken, | ||
} | } | ||
Line 410: | Line 414: | ||
<code c> | <code c> | ||
- | if (orxInput_GetValue(" | + | if (orxInput_HasBeenActivated(" |
orxObject_SetTargetAnim(chicken, | orxObject_SetTargetAnim(chicken, | ||
} | } | ||
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: | + | {{ tutorials:animation: |
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:// |