Commit 754e68e
authored
Add walk animation to townies (#2145)
### RandomTextureSpriteBehavior: Allow idle + walk animation
Assets:
- Rename existing part assets to "idle".
- Add walk animation for the legs part.
RandomTextureSpriteBehavior:
- Export an Array of SpriteFrames resources. Instead of using the custom
addon
to change the textures.
Townie scene:
- Add a CharacterSpriteBehavior to each part. And configure the legs
part with
the new animations.
- Add one .tres file per body part variant. And configure each Array of
SpriteFrames resources with them.
Townie demo:
- Add a FollowWalkBehavior to one townie, and remove the TalkBehavior.
### CharacterSpriteBehavior: Reset frames when back to idle
The townies "idle" has a subtle up and down animation.
For a character made of parts, since the last commit one part (like the
head)
may keep playing "idle" while another (like the legs) may play "walk".
But when
the character is back to idle, all parts should be set in sync again.
Otherwise,
the head may go up when the legs go down, making a funny but not desired
(for
now) dance.
### CharacterSpriteBehavior: Fallback to idle when walk is not available
When the SpriteFrames animation doesn't have an animation named "walk",
use its
"idle" animation for walking. This makes the modding easier, since a
single
animation is now needed for start testing a SpriteFrames in a character
with any
of the walk behaviors. We also use "idle" at double speed for running.
And also, when a character is made of multiple parts, some parts can
stay in the
"idle" animation. Meaning there are less parts to draw.1 parent f4785b5 commit 754e68e
62 files changed
Lines changed: 1576 additions & 266 deletions
File tree
- scenes
- game_elements/characters
- components
- sprite_frames
- npcs
- components
- game_logic/sprite_behaviors
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| |||
0 commit comments