1 00:00:00,000 --> 00:00:00,390 2 00:00:00,390 --> 00:00:02,900 >> DAVID MALAN: So what about a cat who doesn't like you petting him? 3 00:00:02,900 --> 00:00:04,780 Let's implement that. 4 00:00:04,780 --> 00:00:09,680 When green flag clicked, let's forever do the following. 5 00:00:09,680 --> 00:00:13,060 If the cat is touching the mouse pointer, then we'll do one thing. 6 00:00:13,060 --> 00:00:14,770 Else, we'll do something else. 7 00:00:14,770 --> 00:00:18,710 So we need a two-branch condition. 8 00:00:18,710 --> 00:00:22,300 >> And for our Boolean expression, we want to sense whether Scratch is 9 00:00:22,300 --> 00:00:23,890 touching the mouse pointer. 10 00:00:23,890 --> 00:00:28,440 And if so, this time we're going to have him play a sound of not Meow, the 11 00:00:28,440 --> 00:00:31,920 default but rather Lion, the roar. 12 00:00:31,920 --> 00:00:35,470 Else, we'll go ahead and have Scratch meow in the usual way. 13 00:00:35,470 --> 00:00:38,670 >> And thereafter, we'll give him a moment to catch his breath by waiting 14 00:00:38,670 --> 00:00:43,010 two seconds outside of that branch, no matter what sound he happens to make. 15 00:00:43,010 --> 00:00:44,630 Now we click that green flag. 16 00:00:44,630 --> 00:00:46,040 >> [MEOWING] 17 00:00:46,040 --> 00:00:47,390 >> There's that happy cat. 18 00:00:47,390 --> 00:00:53,270 But what if I try petting this cat as by moving my mouse pointer over him? 19 00:00:53,270 --> 00:00:53,990 >> [ROAR] 20 00:00:53,990 --> 00:00:55,240 >> Don't pet that cat. 21 00:00:55,240 --> 00:00:56,377