WEBVTT

1
00:00:00.000 --> 00:00:01.270
In this video, I'll talk about the basic
building block of a program: a function.

2
00:00:01.270 --> 00:00:05.760
A function is a collection of code that
"does something." It has a function.

3
00:00:05.760 --> 00:00:12.660
For example, in our game there's a function to add 
items like coins to the screen, to add platforms, to create a badge.

4
00:00:12.660 --> 00:00:15.200
There are a lot of functions in our game.

5
00:00:15.200 --> 00:00:18.660
If you'd like to follow along, you can
launch the workspace on this page, or

6
00:00:18.660 --> 00:00:21.440
continue working with
your previous workspace.

7
00:00:21.440 --> 00:00:25.570
For example, here's a function
that adds coins to our game.

8
00:00:25.570 --> 00:00:29.380
There are two steps to using a function,
the first step is creating, or

9
00:00:29.380 --> 00:00:30.000
what's called declaring the function.
