WEBVTT
Kind: captions
Language: en

00:00:00.030 --> 00:00:13.830 align:start position:19%
like I was saying there's god [&nbsp;__&nbsp;]
damn hi I'm Michael and I get asked a

00:00:11.820 --> 00:00:17.730 align:start position:19%
lot of questions here on YouTube like I
can't tell if you're 12 or 34 years old

00:00:15.750 --> 00:00:21.240 align:start position:19%
not really a question but you know I
also get asked all the time what

00:00:19.140 --> 00:00:24.900 align:start position:19%
programming language should I start out
with first off you're coming to me for

00:00:22.740 --> 00:00:27.240 align:start position:19%
help so starting bad right out of the
gate and I always say the same exact

00:00:26.789 --> 00:00:31.949 align:start position:19%
thing
it does not [&nbsp;__&nbsp;] matter just pick one

00:00:29.820 --> 00:00:35.370 align:start position:19%
and start learning programming and then
they always say well but luckily I heard

00:00:33.570 --> 00:00:38.879 align:start position:19%
that this one better than this one and
this one's better than this thing and

00:00:36.750 --> 00:00:42.570 align:start position:19%
then I always say all modern programming
languages are wildly powerful and they

00:00:41.010 --> 00:00:47.039 align:start position:19%
can do all kinds of [&nbsp;__&nbsp;] so just pick
one and start learning it and then they

00:00:44.399 --> 00:00:50.760 align:start position:19%
always say they still don't believe me
is what I was trying to say but it

00:00:48.780 --> 00:00:53.250 align:start position:19%
honestly does not matter which one you
choose and to prove that it doesn't

00:00:52.140 --> 00:00:56.579 align:start position:19%
matter I want to do something really
cool and complicated with a doodoo

00:00:54.960 --> 00:01:00.719 align:start position:19%
programming language so let's go right
to the bottom of the barrel and use

00:00:58.230 --> 00:01:04.470 align:start position:19%
scratch scratch is a child's programming
language and I'm not just saying that to

00:01:02.430 --> 00:01:08.430 align:start position:19%
be mean it is literally a programming
language built to teach kids the very

00:01:06.659 --> 00:01:12.210 align:start position:19%
basics of computer programming and
because of that it's not designed to do

00:01:09.990 --> 00:01:16.799 align:start position:19%
anything complicated you can pretty much
only do really dumb animations and make

00:01:14.700 --> 00:01:20.759 align:start position:19%
super simple crappy games look at this
it's a website that runs in your browser

00:01:19.320 --> 00:01:24.689 align:start position:19%
and you're not even allowed to write
code for it you have to drag and drop

00:01:22.890 --> 00:01:28.710 align:start position:19%
these pre-written code blocks over here
to make absolutely anything happen so

00:01:27.150 --> 00:01:33.090 align:start position:19%
it's a language that is essentially a
toy and it would be an absolute

00:01:30.500 --> 00:01:40.950 align:start position:19%
ridiculous pain in the ass to try to do
anything even remotely complicated with

00:01:35.540 --> 00:01:45.360 align:start position:19%
well let's use it to fly a drone huh
this is a parrot AR 2 drone it's verbose

00:01:43.320 --> 00:01:49.259 align:start position:19%
it's reliable and it's one of the
cheapest groans I could find on Amazon

00:01:46.860 --> 00:01:52.770 align:start position:19%
and since I'm gonna crash it at least
multiple times trying to figure out the

00:01:51.180 --> 00:01:56.460 align:start position:19%
scratch controls that's kind of all I
care about now we can focus on setting

00:01:54.360 --> 00:02:00.119 align:start position:19%
up communication between scratch and the
drone thankfully scratch lets you build

00:01:58.079 --> 00:02:03.570 align:start position:19%
your own code blocks with JavaScript
which means you can establish a

00:02:01.409 --> 00:02:07.079 align:start position:19%
WebSocket relationship between those
code blocks and a server running on your

00:02:05.700 --> 00:02:11.459 align:start position:19%
computer that was a lot of very
complicated words that I only understood

00:02:08.819 --> 00:02:16.499 align:start position:19%
about half of so all that it's doing is
taking scratch commands and it's sending

00:02:14.400 --> 00:02:20.579 align:start position:19%
them to a server running on my computer
which is just piping those scratch

00:02:18.420 --> 00:02:24.060 align:start position:19%
commands to the drone yeah but actually
that means I have to know JavaScript

00:02:22.079 --> 00:02:27.780 align:start position:19%
right so it's not actually scratch
[&nbsp;__&nbsp;] you I'm trying to control a drone

00:02:25.829 --> 00:02:31.620 align:start position:19%
with a child programming language here
okay well the flight logic all the user

00:02:29.519 --> 00:02:35.400 align:start position:19%
input data and all of the application
state is gonna be managed by scratch

00:02:33.299 --> 00:02:38.489 align:start position:19%
JavaScript is just communication what
I'm gonna do first is actually take the

00:02:36.870 --> 00:02:43.079 align:start position:19%
reverse approach and I'm gonna take data
from the drone and put it into scratch

00:02:40.620 --> 00:02:47.549 align:start position:19%
now this is an absolutely crucial step
because I think it'd be really funny to

00:02:45.569 --> 00:02:51.930 align:start position:19%
have like flight data readouts so like
how high the drone is in inside of a

00:02:49.859 --> 00:02:53.969 align:start position:19%
children's toy because that would be
funny

00:02:52.560 --> 00:02:57.719 align:start position:19%
so let me show you how that looks this
is the fullscreen scratch application

00:02:55.560 --> 00:03:01.590 align:start position:19%
for what I have so far so if I go over
and start it you can actually see the

00:02:59.909 --> 00:03:06.150 align:start position:19%
gauges down here updating in real-time
so if I go up and down it'll change this

00:03:04.290 --> 00:03:09.959 align:start position:19%
little pitch gauge here and a king is
going up and down if I move left and

00:03:08.010 --> 00:03:13.650 align:start position:19%
right it'll change this roll gauge here
depending on how far it moves and you

00:03:12.150 --> 00:03:17.129 align:start position:19%
know you can do a combination of the two
and it all updates in real time okay

00:03:15.540 --> 00:03:20.909 align:start position:19%
that was super boring but just hang in
there guys I promise I swear to you it

00:03:19.229 --> 00:03:24.810 align:start position:19%
stays about the same level of excitement
throughout the entire video okay Gabe

00:03:22.979 --> 00:03:29.699 align:start position:19%
scratch the ability to fully control the
drones so this little scratch cat icon

00:03:27.419 --> 00:03:34.470 align:start position:19%
represents like a top-down view of the
drone and so I can go over here and I

00:03:32.129 --> 00:03:39.359 align:start position:19%
can start it up and it should start to
take off and now I have full access to

00:03:36.989 --> 00:03:44.510 align:start position:19%
all range of motion of the dirt I can go
forward in fact I'm gonna go left and

00:03:41.579 --> 00:03:50.090 align:start position:19%
right and I can go like up in
and I can go other left and right

00:03:47.780 --> 00:03:54.260 align:start position:19%
exactly like surprisingly easy to
control especially considering how

00:03:51.799 --> 00:03:59.079 align:start position:19%
garbage scratch is it's definitely more
intuitive than like the shitty phone app

00:03:56.329 --> 00:03:59.079 align:start position:19%
that is written before

00:04:00.489 --> 00:04:09.469 align:start position:19%
only problem is I've never flown drones
before us I don't really ah but Michael

00:04:07.519 --> 00:04:12.799 align:start position:19%
I hear you ask how are you ever able to
make something so mediocre and boring

00:04:11.480 --> 00:04:16.400 align:start position:19%
and like I mean I don't even know myself
it's crazy I think you just got to get

00:04:14.510 --> 00:04:20.060 align:start position:19%
born like this but for the first time in
history we can use scratch to make

00:04:18.199 --> 00:04:23.599 align:start position:19%
something more interesting all you got
to do is take those controls jam them

00:04:21.889 --> 00:04:29.660 align:start position:19%
into a shitty scratch game and you give
you to Buddy defender 2018 abridge the

00:04:26.990 --> 00:04:33.770 align:start position:19%
the manga the goal of the game is to
make it until the end but every move you

00:04:31.520 --> 00:04:38.410 align:start position:19%
make in the game actually gets sent to
the drone in real life so it's more like

00:04:36.470 --> 00:04:45.080 align:start position:19%
make it to the end of the game without
obliterating your drone

00:04:41.420 --> 00:04:54.080 align:start position:19%
and if you get hit by a laser you lose
control of the drone temporarily okay

00:04:50.270 --> 00:04:58.910 align:start position:19%
okay as you can see there's also where
are they just avoiding the lasers you

00:04:56.450 --> 00:05:04.490 align:start position:19%
have to keep in mind of the drone and
the the game all my [&nbsp;__&nbsp;] charter Oh

00:05:01.910 --> 00:05:16.610 align:start position:19%
as you can see there's these little
symbols like like I was saying there's

00:05:13.090 --> 00:05:21.530 align:start position:19%
God [&nbsp;__&nbsp;] dead why did I make it so
goddamn hard Oh like I was saying

00:05:18.800 --> 00:05:25.940 align:start position:19%
there's these red rectangles that you
can use to get rid of all the [&nbsp;__&nbsp;] there

00:05:24.020 --> 00:05:30.050 align:start position:19%
subscribe buttons Oh would you look at
that that's convenient look if you just

00:05:28.130 --> 00:05:35.210 align:start position:19%
so happen to smack one of those
subscribe buttons it gets rid of all the

00:05:32.240 --> 00:05:40.280 align:start position:19%
lasers now let's get someone who's far
worse at video games to play hey what

00:05:38.570 --> 00:05:46.550 align:start position:19%
you doing sucking dick it fortnight like
usual oh just oh you said something me

00:05:44.930 --> 00:05:50.360 align:start position:19%
about you you want to play a video game
you want to play a real videogame will

00:05:48.290 --> 00:05:54.020 align:start position:19%
you want to play a real videogame this
one's like left and right do you know

00:05:52.100 --> 00:06:07.850 align:start position:19%
anything about how this game works
no that starts the game oh thanks well

00:06:03.910 --> 00:06:13.070 align:start position:19%
thank you thank you so much you want to
give that another try go ahead and give

00:06:10.790 --> 00:06:18.500 align:start position:19%
it another shot okay just give it a nice
good college try alright oh yeah don't

00:06:16.610 --> 00:06:22.380 align:start position:19%
the penis so you lose control if the
penis

00:06:19.950 --> 00:06:33.390 align:start position:19%
oh that's the altitude it's like it goes
up in the air will you want to be better

00:06:26.250 --> 00:06:37.820 align:start position:19%
at this [&nbsp;__&nbsp;] game alright well give
it one more shot give me one more good

00:06:35.100 --> 00:06:45.360 align:start position:19%
shot your best shot
yeah absolutely

00:06:39.960 --> 00:06:52.940 align:start position:19%
oh subscribe kills all the lasers so
don't forget to smash that subscribe

00:06:46.800 --> 00:06:52.940 align:start position:19%
button I drew all of it I drew all of it

00:07:07.010 --> 00:07:14.310 align:start position:19%
okay that's that's enough of that for
now especially since I think well broke

00:07:11.670 --> 00:07:17.430 align:start position:19%
my drone but thankfully this video is
sponsored by honey now what is honey you

00:07:16.380 --> 00:07:20.490 align:start position:19%
already know what honey is because
everyone's already sponsored by them but

00:07:19.080 --> 00:07:24.480 align:start position:19%
in case you missed it honey it's just a
super simple free browser extension that

00:07:22.680 --> 00:07:28.080 align:start position:19%
sits on your computer and tries to save
you money every time you shop online and

00:07:26.100 --> 00:07:32.340 align:start position:19%
it actually only takes two clicks to get
it so you go to join honey calm slash

00:07:30.150 --> 00:07:37.560 align:start position:19%
read so you click on add to Chrome or
whatever browser are you using click up

00:07:34.530 --> 00:07:41.700 align:start position:19%
here add it to your browser you're done
personally I use it for Amazon and a

00:07:39.450 --> 00:07:45.150 align:start position:19%
bunch of cheap Chinese electronic sites
which it works on because it works on

00:07:43.320 --> 00:07:49.230 align:start position:19%
like 30,000 sites because those are the
only sites I really shop that anyway so

00:07:47.280 --> 00:07:54.090 align:start position:19%
now it's just super nice to randomly get
like 10% off here and there speaking of

00:07:51.360 --> 00:07:57.000 align:start position:19%
saving money someone broke my drone so
we're gonna get a new one boom ugh but

00:07:55.530 --> 00:07:59.880 align:start position:19%
what do you need another drone does it
have anything to do with this tweet you

00:07:58.350 --> 00:08:03.480 align:start position:19%
made about building a drone to kill
babies I don't know you're just gonna

00:08:01.710 --> 00:08:07.800 align:start position:19%
have to wait and see now as well get
this one never had a racing drone before

00:08:05.850 --> 00:08:11.640 align:start position:19%
I'll add it to my cart now that I go to
check out honey's gonna pop up and ask

00:08:09.810 --> 00:08:15.330 align:start position:19%
if I want to apply coupons now it's
searching the internet for the best

00:08:12.870 --> 00:08:18.840 align:start position:19%
coupons possible on this purchase I look
at that I say 14 dollars by doing no

00:08:17.220 --> 00:08:21.750 align:start position:19%
work whatsoever honestly what a lot of
people talk about honey they talk about

00:08:20.490 --> 00:08:26.130 align:start position:19%
how it's gonna save you massive amounts
of money which it can but to me

00:08:24.180 --> 00:08:29.550 align:start position:19%
the really cool part about honey is how
little work you have to put in but you

00:08:27.630 --> 00:08:33.870 align:start position:19%
go to work you do a lot of work you get
a lot of reward you sit at home sit on

00:08:31.470 --> 00:08:38.339 align:start position:19%
the couch do nothing get no reward you
install honey you do no work but you get

00:08:35.880 --> 00:08:41.669 align:start position:19%
summer work it's just like a really cool
thing you have to put in zero work and

00:08:40.140 --> 00:08:45.510 align:start position:19%
get something out of it so if you're
interested in just randomly saving money

00:08:43.529 --> 00:08:48.750 align:start position:19%
sometimes honey is completely free you
can go to the link down in the

00:08:46.589 --> 00:08:52.350 align:start position:19%
description or go to join honey comm
slash read so big thanks to honey for

00:08:50.610 --> 00:08:56.490 align:start position:19%
sponsoring this video it really helps
when it comes to making content so I'll

00:08:54.089 --> 00:09:12.600 align:start position:19%
see you guys when I next upload in five
years

00:08:57.280 --> 00:09:12.600 align:start position:19%
[Music]

