This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
guides:beginners:changing_direction [2015/12/06 12:10 (9 years ago)] – external edit 127.0.0.1 | en:guides:beginners:changing_direction [2018/06/28 07:45 (6 years ago)] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 22: | Line 22: | ||
} | } | ||
else { | else { | ||
- | orxObject_SetTargetAnim(hero, | + | orxObject_SetTargetAnim(hero, |
} | } | ||
</ | </ | ||
Line 28: | Line 28: | ||
The orxObject_SetScale function is being used here instead of the usual orxObject_SetFlip. The latter does not flip child objects or body positions, but scale does. We will need this later when our hero has a child gun object. | The orxObject_SetScale function is being used here instead of the usual orxObject_SetFlip. The latter does not flip child objects or body positions, but scale does. We will need this later when our hero has a child gun object. | ||
- | Notice that we need to restore | + | Compile and Run. We can run left and right and the flipping is correct. But... there is a huge gap when the hero switches directions. |
- | Finally, | + | Therefore we need to ensure the pivot for our hero' |
< | < | ||
[HeroGraphic] | [HeroGraphic] | ||
Texture | Texture | ||
- | TextureCorner | + | TextureOrigin |
TextureSize | TextureSize | ||
Pivot = center | Pivot = center | ||
+ | |||
+ | [HeroAnimationSet] | ||
+ | Texture | ||
+ | FrameSize | ||
+ | HeroRun | ||
+ | HeroIdle | ||
+ | StartAnim | ||
+ | HeroIdle-> | ||
+ | HeroRun-> | ||
+ | Pivot = center | ||
</ | </ | ||
- | Compile and run. We can run left and right. That should be working | + | |
+ | Compile and run. That should be working | ||
---- | ---- | ||
- | Next, [[guides: | + | Next, [[en:guides: |
+ | |||
+ | {{section> |