hi and welcome to the coding in sports
exploration in this video we'll give a
quick overview of computer programming
and see how we can use block coding to
create our own sports video games let's
jump in computer programs are the way we
communicate with the computer and give
it instructions kind of like the way a
professional soccer player tells their
feet when to kick the ball and where to
direct it but did you know that computer
programming can also be used in sports
computer programs can be used in many
aspects of sports from processing
different stats to creating games
simulations today you'll be creating
your own sports video game by developing
a computer program we'll be using Java
Script which is one of today's most
widely used programming languages let's
get started we'll be using block coding
to create our game so let's take a look
at how the editor works you'll see this
green block titled program in the middle
of the screen
whatever we drop here will be read by
the computer and added to our game which
will load in this area on the right side
of the screen on the left side you'll
see the coding blocks library that you
can use to create your game see how all
of the coding blocks are color-coded and
in their own library sections we'll be
creating a simple make a shot game where
the objective is to bounce an object
into a goal we will need to set the
background of our game what the ball
object looks like what the goal looks
like and what kind of paddle we use to
bounce the object around let's start by
setting our background to add each of
these components I need to drag the
block so that it snaps into place
in my program block did you hear that
click if the block isn't snapped in the
computer will not read and load the
block I can use one of these preset
images or I can upload my own image
I'll go to the upload tab here select
upload file and select the image that I
want to upload then a link is generated
that I can use to load the file in my
program I'll need to remove the current
image block that is snapped in to delete
a block you can either drag it to the
trash can or select the block and press
the delete button on your computer now I
need to find the image block with custom
images
it's this one right here that has a URL
I'll go ahead and paste the file URL
that I copied into this block great now
that I've added the background I need to
add the goal paddle and bowl for my game
you
for the paddle I'll use one of the
preset images if you want to see what
your program looks like you can always
click run to run the program and see how
your game looks if you make any changes
you can just click run again to see an
updated version of your program once
you're happy with your game click this
share button to generate a link that you
can send to your friends and family now
it's your turn we hope you enjoy making
your sports video game