 Okay, welcome to basic animation in Python 3 part 5 and this part 5 will be using Lists to keep a list of the different shapes that we're using And the reason we're doing this is that once we switch to a list-based method Then we can have any number of frames that we want without really changing the code So this is a bit more advanced if you're not familiar with using lists. You can check out my my list Video in my basic Python 3 introduction Somebody remind me. I'll put a link down below For you to see that. Okay, so in the previous video what we did was we we introduced the concept of a frame So we start at frame zero and then we show a certain image Based on that frame. Okay, and then each time we we change the frame number, then we show a different image Okay, so here's what we're going to do watch watch them learn here. Okay, so for this particular You know player this particular sprite. We've got two frames. So watch what I do here. I'm gonna say player dot frames Equals so notice it's frame and frames. Don't confuse the two and my first one is invader.jif My second one is invader2.jif Now with lists if you're not familiar, but you should be because you shouldn't be watching this unless you've brushed up on lists. This is Zero and this is one. That's just the way computers work. It's just the way programming works. I should say So in here what we're gonna do and watch this This is worth your this is worth your admission price today. I'm gonna say player dot frame plus equals one Okay, what that does is every time I call this method this frame is incremented by one So when I call it I go plus one Now what I have to do is I have to make sure that I haven't gone over The number of frames so in this case we got zero one if I go to two I'm gonna get an error because there is no two. There's only zero and one so if Player dot frame is greater than or equal to the length of player dot frame Okay, because the length of this frames is one two. There's two of them. So if player frame somehow is greater than or equal to that length Because this is zero. This is once a little confusing. This is zero and one index But there's two together two all together then we say player dot frame Equal zero and that will keep recycling through the list of frames. So then all we gotta do is player dot shape Player dot frames Rackets player dot frame So what that does is it sets the player shape? To One of these images so if the frame is zero it sets it to this image if the frame is one It sets it to this image Okay, and what's great about this as I mentioned earlier is that if I had invader gif three four five six seven I had 27 it wouldn't matter this code will work for any size of frames or of frames lists that you have okay, so let's go ahead and test it Okay, and you can see the animation is still working just as it did before there have been no changes So that's the basic animation tutorial. This is what you got to do with your Animations, this is how this is how it works now the problem with this is Let's say I had player two Okay, if I had player two I would have to copy all this code Paste it change everywhere. It says player to player two and Then down and then I have to call player animate to it would just be a huge huge mess So in the next video, I'm going to show you how to use classes to avoid that. It's a bit more advanced topic Some of you might not be ready for it, but I'll give I'll do my best to try and explain it But if you never use classes or objects before Probably isn't the video to start with so if you're interested in learning more about that come back for part 6, I'll see you there