1 00:00:00,930 --> 00:00:03,060 in today's video tutorial we're going to 2 00:00:03,060 --> 00:00:04,530 be learning how to use the point 3 00:00:04,530 --> 00:00:07,470 toward an the point in direction blocks under the 4 00:00:07,470 --> 00:00:09,720 motion tab in the online version of 5 00:00:09,720 --> 00:00:10,410 scratch 6 00:00:11,550 --> 00:00:12,540 as you can see i have a 7 00:00:12,540 --> 00:00:14,610 new project open and i have it 8 00:00:14,970 --> 00:00:17,790 named and saved we're going to start 9 00:00:17,790 --> 00:00:19,500 off by selecting our sprites 10 00:00:20,940 --> 00:00:23,430 for today's tutorial i'm going to be 11 00:00:23,430 --> 00:00:25,650 using the shark sprite and i'm also 12 00:00:25,650 --> 00:00:28,560 going to use the fish sprite 13 00:00:32,460 --> 00:00:35,422 the purpose of using that point towards 14 00:00:35,430 --> 00:00:37,980 and the point in direction blocks is 15 00:00:37,980 --> 00:00:39,960 to have one sprite point in the 16 00:00:39,960 --> 00:00:42,600 direction of another sprite so for the 17 00:00:42,600 --> 00:00:44,880 purpose of today's tutorial what i want 18 00:00:44,970 --> 00:00:46,290 is for my shark to point in 19 00:00:46,290 --> 00:00:48,240 the direction of my fish and i 20 00:00:48,240 --> 00:00:49,830 want him to chase my fish 21 00:00:50,340 --> 00:00:51,990 so let's begin programming that 22 00:00:54,450 --> 00:00:57,270 i'm going to need under the events 23 00:00:57,300 --> 00:01:00,870 tab though when clicked block i'm going 24 00:01:00,870 --> 00:01:03,330 to need under the motion the move 25 00:01:04,170 --> 00:01:07,200 block the point into the direction and 26 00:01:07,200 --> 00:01:10,230 point towards block before we get started 27 00:01:10,230 --> 00:01:12,450 with a point towards block let's take 28 00:01:12,450 --> 00:01:13,200 a look at the 29 00:01:13,200 --> 00:01:14,670 point in direction block 30 00:01:17,160 --> 00:01:18,990 so as you can see when i 31 00:01:18,990 --> 00:01:20,880 click on this my shark is moving 32 00:01:20,880 --> 00:01:21,540 to the right 33 00:01:22,590 --> 00:01:24,180 so we're just saying what direction we 34 00:01:24,180 --> 00:01:25,890 want him to point in you can 35 00:01:25,890 --> 00:01:28,110 plug in any number between zero and 36 00:01:28,110 --> 00:01:30,720 three hundred and sixty if i plug 37 00:01:30,720 --> 00:01:33,000 in one eighty i'm saying that i 38 00:01:33,000 --> 00:01:34,920 want him to point in and in 39 00:01:34,920 --> 00:01:36,360 the direction downward 40 00:01:37,620 --> 00:01:40,110 if i put in a negative ninety 41 00:01:40,650 --> 00:01:42,690 going be pointing to the left 42 00:01:44,220 --> 00:01:45,960 and if i plug in zero is 43 00:01:45,960 --> 00:01:47,520 going to be pointing upward 44 00:01:49,650 --> 00:01:52,350 for today's tutorial i'm going to put 45 00:01:52,350 --> 00:01:53,970 him back at ninety degrees so he 46 00:01:53,970 --> 00:01:55,320 is facing the right 47 00:01:57,180 --> 00:01:59,370 now we can throw this point in direction 48 00:01:59,370 --> 00:02:01,860 block back and take a look at 49 00:02:01,860 --> 00:02:04,680 the point towards and addition of these 50 00:02:04,680 --> 00:02:06,450 blocks i need to go to control 51 00:02:06,660 --> 00:02:08,310 and i need to take out the 52 00:02:08,310 --> 00:02:10,979 wait block and also the forever block 53 00:02:12,240 --> 00:02:13,530 i'm going to be putting in my 54 00:02:13,560 --> 00:02:17,370 point towards block my move ten steps 55 00:02:17,370 --> 00:02:19,800 block and my wait one second block 56 00:02:19,830 --> 00:02:22,890 all within the forever block what i'm 57 00:02:22,890 --> 00:02:24,990 saying is that when clicked i want 58 00:02:24,990 --> 00:02:28,230 my shark to point toward my fish 59 00:02:28,770 --> 00:02:30,150 the other option would be your mouse 60 00:02:30,150 --> 00:02:31,950 pointer but for today i'm going to 61 00:02:31,950 --> 00:02:32,130 do 62 00:02:32,190 --> 00:02:34,410 fish and i want him to move 63 00:02:34,410 --> 00:02:38,040 toward the fish ten steps continuously with 64 00:02:38,040 --> 00:02:40,350 one minute or one second intervals 65 00:02:41,640 --> 00:02:43,170 now let's program our fish 66 00:02:44,760 --> 00:02:46,200 i'm going to need the wait 67 00:02:47,460 --> 00:02:51,210 the forever block under control and then 68 00:02:51,210 --> 00:02:54,000 i'm going to need that when clicked 69 00:02:54,000 --> 00:02:57,060 block and i'm also going to need 70 00:02:57,090 --> 00:03:00,570 the move block under motion 71 00:03:05,220 --> 00:03:07,200 i'm going to put my wait and 72 00:03:07,200 --> 00:03:09,330 my move blocks within the forever tab 73 00:03:10,110 --> 00:03:11,580 and as you can see with the 74 00:03:11,580 --> 00:03:13,740 fish i have my wait one second 75 00:03:13,770 --> 00:03:16,740 placed above my ten steps that's because 76 00:03:16,800 --> 00:03:18,450 when the shark is moving i want 77 00:03:18,450 --> 00:03:20,760 my fish to wait so that the 78 00:03:20,760 --> 00:03:21,810 timing between them 79 00:03:21,870 --> 00:03:25,140 is put together better let's see what 80 00:03:25,140 --> 00:03:26,730 happens with the shark when i click 81 00:03:26,730 --> 00:03:27,300 on this 82 00:03:29,880 --> 00:03:31,950 ok perfect that's exactly what i want 83 00:03:31,950 --> 00:03:32,490 him to do 84 00:03:34,290 --> 00:03:36,210 and when i click on my fish 85 00:03:38,220 --> 00:03:40,800 perfect and now let's see when we 86 00:03:40,800 --> 00:03:42,090 have them both going at the same 87 00:03:42,090 --> 00:03:44,430 time if we can achieve that chase 88 00:03:50,280 --> 00:03:50,790 perfect 89 00:03:52,080 --> 00:03:53,790 you also have the option of course 90 00:03:53,790 --> 00:03:56,400 to change the timing for my fish 91 00:03:56,580 --> 00:03:58,350 i want him to go faster than 92 00:03:58,350 --> 00:04:00,330 the shark i'm going to change the 93 00:04:00,330 --> 00:04:02,190 timing from one second to point two 94 00:04:02,190 --> 00:04:05,010 five and then i'm going to change 95 00:04:05,010 --> 00:04:07,410 the timing from a shark to point 96 00:04:07,410 --> 00:04:09,630 fifties there is a little slower than 97 00:04:09,630 --> 00:04:11,820 my fish let's take a look 98 00:04:17,279 --> 00:04:19,682 and that concludes our video tutorial for 99 00:04:19,682 --> 00:04:20,070 it today