1 00:00:00,270 --> 00:00:01,859 in this tutorial we are going to 2 00:00:01,859 --> 00:00:05,130 be using logic operations first of all go to 3 00:00:05,130 --> 00:00:08,010 numbers and select these scripts here you 4 00:00:08,010 --> 00:00:10,830 can see these are logic operations these 5 00:00:10,830 --> 00:00:13,680 have two or more operands or either 6 00:00:13,680 --> 00:00:14,580 true or false 7 00:00:15,960 --> 00:00:17,430 i will be showing you examples of 8 00:00:17,430 --> 00:00:19,920 possible combinations they are going to be 9 00:00:19,920 --> 00:00:22,470 controlling an action and then this example 10 00:00:22,470 --> 00:00:24,630 will be a sound so in sound we 11 00:00:24,630 --> 00:00:27,540 can select play sound next we need 12 00:00:27,540 --> 00:00:30,270 a control and that will be forever 13 00:00:30,450 --> 00:00:32,100 and if then 14 00:00:35,970 --> 00:00:38,730 make sure you don't forget to click 15 00:00:38,820 --> 00:00:42,990 the when green flag clicked next go 16 00:00:43,050 --> 00:00:43,920 to sensing 17 00:00:45,150 --> 00:00:47,340 and we need to select touching mouse 18 00:00:47,340 --> 00:00:47,850 pointer 19 00:00:49,350 --> 00:00:52,080 so the first example we can use 20 00:00:52,080 --> 00:00:54,300 the not we want to play a 21 00:00:54,300 --> 00:00:56,760 sound when something is not happening and 22 00:00:56,760 --> 00:00:59,100 that could be touching the other sprite 23 00:01:01,650 --> 00:01:03,660 so when it's not touching the sprite 24 00:01:03,690 --> 00:01:05,850 it will make the noise so let's 25 00:01:05,850 --> 00:01:08,070 make it touch the second sprite we 26 00:01:08,070 --> 00:01:09,630 can hear that is not making 27 00:01:12,180 --> 00:01:13,260 so it isn't touching 28 00:01:14,550 --> 00:01:16,170 the sound 29 00:01:19,980 --> 00:01:22,740 next we can use the or operation 30 00:01:23,520 --> 00:01:25,230 to this we are going to be 31 00:01:25,230 --> 00:01:30,180 comparing two values so we duplicate this so 32 00:01:30,600 --> 00:01:35,430 when touching sprite two or when touching 33 00:01:35,640 --> 00:01:37,440 the edge so 34 00:01:37,470 --> 00:01:39,750 here the condition is that script one 35 00:01:39,750 --> 00:01:41,580 will make a sound if is touching 36 00:01:41,580 --> 00:01:42,510 sprite two 37 00:01:44,670 --> 00:01:46,560 not touching one or the other then 38 00:01:53,550 --> 00:01:56,910 finally we can use the and operation 39 00:01:57,510 --> 00:01:59,550 we can use the same touching sprite 40 00:01:59,550 --> 00:02:00,000 two 41 00:02:01,380 --> 00:02:04,140 and touching edge so for the sound 42 00:02:04,140 --> 00:02:06,270 to play it has to be touching 43 00:02:06,270 --> 00:02:08,880 the sprite and the edge 44 00:02:10,199 --> 00:02:12,300 here we can hear that it only 45 00:02:13,530 --> 00:02:15,360 touching script two then it will not make 46 00:02:15,360 --> 00:02:17,520 a sound and if only touches the 47 00:02:17,520 --> 00:02:19,320 edge it will not make a sound 48 00:02:20,400 --> 00:02:22,470 after that true to make a sound