March Madness Basketball Game

Build upon a few techniques we learned in past CoderDojo sessions!

  1. Shoot basketball (clones!) with keyboard control and broadcast messages

  2. Animate a sprite with costumes to show a velocity meter

  3. Use variables for basketball motion (velocity and gravity)

  4. Keep track of baskets completed with a Score counter

  5. Determine end of game with a Ball counter

Sign in at Scratch

Go To: http://scratch.mit.edu/

scratch-signin

CoderDojo Indigo Studio

Go To: http://scratch.mit.edu/studios/585122/ and click march_madness_starter

CoderDojo Indigo

Click the "See inside" button

Notice the sections: Title, Instructions and Notes and Credits

see-inside

Click the "Remix" button

This will make a copy of the project under your name

remix

Rename the Project

It's a good practice to name your project something unique

rename

Select the "Stage" to set it up

Set a Sound script + scripts to show which backdrop to display upon start and end of game

stage

Select the "leprechaun" sprite

We want the Leprechaun to shoot from the throw line

leprechaun

Select the "hoop" sprite

We want the hoop on the backboard and to always remain in front

hoop

Select the "basketball" sprite

Set up all variables and our first clone upon start + what to do as a clone

basketball1

Ths is the main basketball script!

When the "Shot" message is received: start the motion, check for the backboard or hoop "collision" and score!

basketball2

Select the "Sprite1" sprite (Velocity Meter) - Costumes

Check out the costumes: the different costumes represent the velocity bar that will animate. We will use the costume # to determine how hard the ball is thrown.

velocity-meter1

Select the "Sprite1" sprite (Velocity Meter) - Scripts

Upon receiving the "New Shot" message, the velocity meter will animate costumes until the "space" key is pressed to throw a ball, using the velocity.

velocity-meter2

Congratulations!

You built a cool Basketball game! Now, here are a few Challenges:

  1. Add additional costumes for the character when he throws the ball.

  2. Allow the character to move left / right and throw the ball at different angles.

/