 OK, welcome to basic animation in Python 3, part 3. So this is what we currently have. Cancel, hit the wrong button, so it's function f5. And we have our turtle animating every half a second. It's changing its shape. But it's blocking the main loop. It's blocking the rest of the program from running. So I'm going to show you how to get around that today. And we're going to do that by using something called the on-timer method. And this is part of the turtle module. So if you're using something like PyGame, it has its own version of this. If you're using TKInter, it has its own version of this. Actually, the turtle module is built on TKInter. So here's what I'm going to do. I'm going to watch what I'm doing here. I'm going to stop using this time module. I'm not going to need it anymore. So actually, let me think about this. Now I don't need that anymore. So watch what I do here. This is a little bit more complicated. So basically, what I've got to do is I've got to find out if the player, if its shape, is a square, then we want to change the shape to a circle. So this will give us the current player's shape. And then we'll see if it's a square. And if it's a square, we'll change it to a circle. Else if the player.shape equals a circle, we only have two shapes. So this is pretty straightforward. Player.shape equals square. And you might have to be real careful there. You see what I did? Here we're using equal signs. Here we're using a function call. So you've got to be careful there. Now the problem is, I'm going to go ahead and run this. And you'll see what happens. It's really hard to see, but this is changing so fast that you can't tell there's an animation going on there. So now if I put time.sleep back in here, time.sleep 0.5, and if I run it, we'll get our animation. But again, the main loop is blocked. It's only running once per second. And usually you're going to need that main loop running about maybe 30 times a second is a good frame rate. So here's what we're going to do. Now watch this. This is pretty cool. We're going to use the on timer method. So we're going to set a timer. And it's win, because we put win up here, dot on timer. And then I'm going to put player animate comma 500. Let me explain that. So what this does is it sets a timer. And it says after 500 milliseconds, which is half a second, call the function player animate. Notice there's no parentheses here, even though there's parentheses here. It's going to call this function every half a second. Now watch what I do here. This is important. So I only need to call this method one time. And I have to pull this back. Over to the left. So before my while true loop, I'm going to do it. I'm going to call this method. That will update the animation and set the timer. And then it keeps calling it and calling it and calling it. Meanwhile, the while true loop is going to keep running. Now we're probably going to see a little bit of an error here or a bug. And I'll explain it in a second. F5, I'm going to run it. So you can see how it's not changing. But the main loop is running. If you look here, you can tell it's running a little bit. And you see I got the little red spinny beach ball. This will possibly lock up your computer. So hopefully you didn't start running this until I finished the explanation. The reason for this is it just locks up the thread. It's kind of hard to explain. So to fix this, you put in here win.update. And that makes sure that the loop takes a little break and then updates the screen for you. So I hit function F5. Now we see the animation is running. And the main loop is still running. It's just going, going, going, going. It's going really, really fast now. So we could, at this point in the main loop, we could have other things moving on the screen. We could be playing sounds, checking for collisions, et cetera, et cetera, checking the score, checking to see if there's lives left, all those kinds of things. But notice the animation keeps running. So that's pretty cool. So that is kind of where we're at with this now. So I'm going to stop there. And in the next video, we're going to learn how to do this, I believe it's the next video. We're going to learn how to do this with pictures, possibly. So let's find out. I can't remember what the actual next one is. Talk to you soon.