This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:guides:beginners:running_and_standing [2018/02/13 20:47 (7 years ago)] – ↷ Page moved from guides:beginners:running_and_standing to en:guides:beginners:running_and_standing iarwain | en:guides:beginners:running_and_standing [2024/11/18 04:18 (4 months ago)] (current) – Highlights sausage | ||
---|---|---|---|
Line 3: | Line 3: | ||
Our little hero keeps running and facing the same direction. | Our little hero keeps running and facing the same direction. | ||
- | He needs to be able to stand still when not running. To do this, he needs add an idle animation. | + | He needs to be able to stand still when not running. To do this, we need to add an idle animation. |
- | An idle animation would be simply playing hero frame 1 from the spritesheet over and over. Let's create a '' | + | An idle animation would be simply playing hero frame 1 from the spritesheet over and over. Let's create a '' |
- | < | + | < |
[HeroAnimationSet] | [HeroAnimationSet] | ||
Texture = soldier_full.png | Texture = soldier_full.png | ||
Line 23: | Line 23: | ||
</ | </ | ||
- | Some links are now needed. | + | Some links are now needed. |
* Idle to Run | * Idle to Run | ||
Line 32: | Line 32: | ||
Add all the possible links to '' | Add all the possible links to '' | ||
- | < | + | < |
[HeroAnimationSet] | [HeroAnimationSet] | ||
Texture = soldier_full.png | Texture = soldier_full.png | ||
Line 50: | Line 50: | ||
</ | </ | ||
- | ...means that when the HeroRun animation finishes, it could branch off to HeroRun again or HeroIdle, depending what the current target animation is set to. | + | ...means that when the '' |
- | + | ||
- | [KILL THIS PARA] A note on the Priorty = 7 property for the last link. All links have a priority of 8. When the hero stops running, we want it to calculate back to the HeroIdle animation. We don't know if HeroRunLinkLoop will execute or if HeroRunToIdleLink will. Lowering the priority of HeroRunToIdleLink will ensure our hero will play the idle animation. | + | |
- | When the right key is pressed, the run animation | + | When the right key is pressed, the run animation,'' |
- | < | + | < |
if (orxInput_IsActive(" | if (orxInput_IsActive(" | ||
{ | { | ||
Line 66: | Line 64: | ||
</ | </ | ||
- | Compile and run. Pressing right will start the run animation, and letting go will revert back to the idle animation. But notice it takes about a second for the animation to start. | + | Compile and run. Pressing |
- | This is because of the 1.0 set as the default duration on the [HeroIdle] section. We could reduce this duration value to something smaller, but a more correct way would be to ensure that any request to play the run animation is delivered immediately. Change the HeroIdle link from: | + | This is because of the 1.0 set as the default duration on the [HeroIdle] section. We could reduce this duration value to something smaller, but a more correct way would be to ensure that any request to play the run animation is delivered immediately. Change the '' |
< | < | ||
Line 86: | Line 84: | ||
That takes care of running and stopping while facing right. But what about left? | That takes care of running and stopping while facing right. But what about left? | ||
- | Let try that now. | + | Let' |
---- | ---- | ||
- | Next: [[guides: | + | Next: [[en:guides: |
- | {{section> | + | {{section> |