Hello, world-wide-web, how is everyone?
Another thing I wanted to talk about is, what do you do it you want to animate a character? Say your character is several different images. How do we deal with that?
The easiest way is to use an animated sprite.
...
How do we animate sprites?
I'm glad you asked.
If you open up a sprite node, you will see a tab in the inspector titled "Animation". Let's see what that is.

HFrames? VFrames? What is a Frame, even?
Just for the fun of it, increase the HFrames property. What happens?

Mine got chopped in half? What is it doing?
Simply put, it is dividing the sprite based on the amount of frames each sprite has. HFrames divides it vertically, and VFrames divides it horizontally.
Why wouldn't VFrames divide vertically, and HFrames divide horizontally?
I don't know, I didn't design Godot. I just write tutorials about it. :)
However, what if we want to show a different frame? Well, let's mess with the Frames property.

Okay, so the frames will select the next frame in the sprite, based on the amount of HFrames andVFrames.
But what if your animations are a number of images, not just one image with animations?
We could simply change the texture over time, but who wants to do that?
Lets type in our browser, "Godot animated sprite".
The first thing that pops up is something called Animated Sprite in the docs. What does that say?

Great! There's a node for that!
So, let's add a new scene, and search for an animated sprite...
Now hold up. An animated sprite only plays animations. It cannot detect collision or cause collision. It is useful for decorations that you are okay with trampling over, but that's as far as it goes.
Because of this, it might be a better idea to use a body or an area.
Remember when I said I would use the lock sprite for my door? The reason is because, as you saw it, it is a group of images.
Because of this, I will use my door node for this section. If you have another item that animates, you can use that.
I will remove the sprite and add an animated sprite in its place.
Great! Now, how do we animate with it?
What does the inspector show?

The first thing that pops up is Frames. Click on the box next to that, what is that?
A thing that says New SpriteFrames? we've seen frames in a sprite before. Let's click on that as it sounds promising.
Nothing happened.
Click on the new SpriteFrames.

Now, what in the world is all this?
Well, this panel is where you add your images for your animations. Lets say you have an idle animation. In this panel, you can drag and drop the images for the idle animations right into this panel.

We can drag and drop as many images as we want into this panel, and even reuse the same ones as many times as we need for a smooth animation.
Now, what if I need a new animation?
Inside this new panel, there is a section called Animations, and has a little scroll with a plus arrow, and a trash bin. By the looks of it, the plus scroll adds an animation, and the trash bin removes a selected animation.

So, let's add the plus button and name the new animation. Now, we can add images to the new animations.
So, what if my images are on one image?
Well, first off, what other properties do we have in this panel?

Hover over each one with the mouse to see what it does.
One of these properties, when hovered over, says "Add Frames from a Sprite Sheet.
What is a Sprite Sheet?
A quick online search will show you images with multiple animations in them.
This property is what we need.Select it, and then select the sprite sheet that needs animated.

Now, we notice that the images are all divided in a weird way. How do we fix that?
At the top left, we see Horizontal and Vertical... and it has numbers, sort of like HFrames and VFrames.
So, let's use Horizontal and Vertical to divide it so that the images are divided correctly.
Now what?
Now select the frames that you need for your specific animation. I need all of mine, so I will use the button at the top-right that says Select/Clear All Frames. Then click on the button that says it will add the amount of your selected frames.
Great! We see the images, but... the animation isn't playing.
Let's click on the AnimatedSprite again, and check out the properties again.
One of the properties is called Playing... click on that, what does that do?
Now the animations are playing! However, the speed is a bit off, and the animations keep playing. For some animations constantly playing, that's fine, but I don't want my door to keep opening and closing.
Let's work on fixing that first.
What other properties does this panel have...
Loop. What happens if I turn that off?
Hey, the animation now only plays once!
However, now what about the speed-wait. Right above Loop, there is a thing called speed. That must change the speed of the animation.
So, now my challenge for you is to set your animations up the way you want them to play. I will see you in the next one.