>> SPEAKER 1: Let's take a look at a program that I've been working on that
has two sprites, each of which has its own script.
The biggest takeaway of this program is that you can indeed have not only
two sprites, but those sprite scripts can run in parallel.
That is, at the same time, which is to say that's from scratch gives us
multithreaded programming environment, whereby two things can happen
literally at the same time.
>> Now here we have first our bird sprite.
And notice that this bird has one script.
Let's zoom in.
Now according to this script, when the green flag is clicked the bird is
going to move to negative 150, 150.
So really, the top left-hand corner of the stage.
And then he's going to point downward at a 45-degree angle.
>> Then he's forever going to do the following.
If he is not touching the cat, he's going to move three
steps or three pixels.
And if he's on the edge of the stage, he's going to bounce.
And then he is going to do that again and again and again.
In other words, this bird is going to flutter around the stage.
>> Meanwhile, the cat is going to be doing the following.
He's going to start at negative 160, negative 160.
So really, the bottom left-hand corner of the screen.
And he's going to pick a random direction in which to point.
>> Thereafter, he's going to forever do the following.
If he's touching the bird, he's going to play the lion sound and roar, and
then he's going to stop, thereby ending this animation.
Otherwise he's going to point himself toward the bird and move one step.
>> In other words, the cat is going to perpetually follow this bird, but not
quite at the same pace, thereby giving the bird a bit of an advantage.
Well, let's see what happens when we do run these scripts.
>> Let's go ahead and click our green flag.
And they're off.
Notice that the bird is coming up on the edge of the stage.
And, indeed, he bounces.
And again, bounces off that edge.
>> The cat, meanwhile, is really homing in on this bird.
He's almost about to catch him after one more bounce it seems.
And--
>> [ROAR]
SPEAKER 1: Indeed, he's been caught.