This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:guides:beginners:changing_direction [2018/06/28 04:45 (7 years ago)] – In line with init projects sausage | en:guides:beginners:changing_direction [2024/11/18 04:27 (8 months ago)] (current) – Highlights sausage | ||
---|---|---|---|
Line 5: | Line 5: | ||
There are many ways to do this. The more correct way would be to create flipped animation graphics and hook up a bunch more animations and links. But we will do it the easiest way possible. When pressing the left key, we will flip the entire hero around in code: | There are many ways to do this. The more correct way would be to create flipped animation graphics and hook up a bunch more animations and links. But we will do it the easiest way possible. When pressing the left key, we will flip the entire hero around in code: | ||
- | < | + | < |
orxVECTOR flipLeft = { -2, 2, 1 }; | orxVECTOR flipLeft = { -2, 2, 1 }; | ||
orxVECTOR flipRight = { 2, 2, 1 }; | orxVECTOR flipRight = { 2, 2, 1 }; | ||
Line 32: | Line 32: | ||
Therefore we need to ensure the pivot for our hero's graphic and animation set are both centered so that when we flip left and right, there won't be any issues with the physically body shifting incorrectly: | Therefore we need to ensure the pivot for our hero's graphic and animation set are both centered so that when we flip left and right, there won't be any issues with the physically body shifting incorrectly: | ||
- | < | + | < |
[HeroGraphic] | [HeroGraphic] | ||
Texture | Texture |