User Tools

Site Tools


en:guides:beginners:running_and_standing

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
en:guides:beginners:running_and_standing [2018/02/13 20:47 (6 years ago)] – ↷ Links adapted because of a move operation iarwainen:guides:beginners:running_and_standing [2018/06/28 04:38 (6 years ago)] – In line with init projects 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 ''HeroIdle'' animation  in the HeroAnimationSet and set it as the starting animation: An idle animation would be simply playing hero frame 1 from the spritesheet over and over. Let's create a ''HeroIdle'' animation  in the HeroAnimationSet and set it as the starting animation:
Line 23: Line 23:
 </code> </code>
  
-Some links are now needed. Remember, you are starting to build a graph of animations. Now that you have two animations, they can link in several ways:+Some links are now needed. From here on, you are actually starting to build a graph of animations. Now that you have two animations, they can link in several ways:
  
   * Idle to Run   * Idle to Run
Line 50: Line 50:
 </code> </code>
  
-...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 ''HeroRun'' animation finishes, it could branch off to ''HeroRun'' again or ''HeroIdle'', depending what the current target animation is set to.
  
 [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. [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 (''HeroRun''needs to play by setting it as the target animation. And when right is released, the target is set to ''HeroIdle'', and the graph must calculate it's way back to "Idle" as the animation to play:+When the right key is pressed, the run animation,''HeroRun''needs to play by setting it as the target animation. And when right is released, the target is set to ''HeroIdle'', and the graph must calculate it's way back to "Idle" as the animation to play:
  
 <code=cpp> <code=cpp>
Line 66: Line 66:
 </code> </code>
  
-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 and holding 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.
  
-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 ''HeroIdle'' link from:
  
 <code=ini> <code=ini>
en/guides/beginners/running_and_standing.txt · Last modified: 2021/07/14 23:19 (3 years ago) by creampuff