In Storytelling, students use computer science to tell fun and interactive stories. Storytelling emphasizes creativity by encouraging club members to tell a unique story each day.
In Friends, students are encouraged to sign up with a friend or make a new friend in the club. Friends emphasizes teamwork by allowing club members to tell the story of how their friendship started and imagine a company together.
In Fashion & Design, students learn how computer science and technology are used in the fashion industry while building fashion-themed programs, like a fashion walk, a stylist tool, and a pattern maker.
In Art, students create animations, interactive artwork, photograph filters, and other exciting, artistic projects.
In Social Media, students create fun social media style applications and games while learning about the computer science concepts that enable these programs to work.
In Sports, students use computer science to simulate extreme sports, make their own fitness gadget commercial, and create commentary for a big sporting event.
In Music & Sound, students use the computer to play musical notes, create a music video, and build an interactive music display while learning how programming is used to create music.
In Game Design, students learn basic video game coding concepts by making different types of games, including racing, platform, launching, and more!
Students create fun and complex animated projects. This is an advanced curriculum, which means it teaches new concepts that are recommended for students who have already participated in at least two other CS First themes.
In this sample activity students animate an ocean wave to create a setting, then tell a story that takes place on the high seas.
In this sample activity students tell a story using the characters from Cartoon Network’s "The Amazing World of Gumball."
Be a designer and programmer – bring the Google logo to life using code.
This add-on is your introduction to artificial intelligence. Just like what computer opponents in video games and self-driving cars use. The example in the video will show you two ways of programming the opponent. The first is easier to program, but much harder to defeat.
The second involves more code, but it gives the player a fighting chance.
First, duplicate the athlete. If you’ve already programmed a second player, you can use that sprite as the computer player. Either way, disconnect the second player’s code from the “when flag clicked” event, so that it’s still there but doesn’t run.
Next, go to costumes, click “flip up-down,” and move the new sprite to an opposing position at the top of the screen. The first way to program this is to make the sprite always go to the same left-right position as the ball sprite. In the “scripts” tab, from the “motion” menu, drag out a “set x to” block. The number in the x value represents the sprite’s position from left to right on the stage. For instance, zero is anywhere along this middle line of the stage, 240 is the right edge of the stage, and negative 240 is the left edge of the stage. Go to the “sensing” menu. Into the “set x to” block, put the rounded block that says, "x position of sprite." From the second dropdown in the sprite, select the ball sprite. This block now reads, “set the computer player’s left-right position to be the same as the left-right position of the ball sprite.”
Click it to see if the computer sprite changes position.
Just like in the “bounce reaction” add-on and the “keep score” add-on, it’s not enough to do this once. The sprite needs to keep doing this to be a worthy opponent. Wrap the block in a “forever” loop. Then, place a “set rotation style” block, on top of the block stack, and select “left-right” from the dropdown. Finally, start the stack off with a “when flag clicked” block. You just created the first computer opponent.
Try it out! Then, try programming a more realistic computer opponent. To do that, follow the rest of this video. This next part is more challenging, but it will result in a cooler project that more closely resembles a real game! Start by disconnecting the last code stack from the event so it doesn’t run. Then, duplicate the original block stack.
Here’s what you’re about to program: The computer sprite will act a lot like a real human player. It will move in the direction of the ball just as fast as your player.
Modify the new code stack to make it automatic. Start by removing and discarding the “key pressed” sensing blocks. Replace them with blocks from the “operators” menu. Place a “greater than” block in the first blank. Into the second blank, drag a “less than” block. Drag another "position of sprite" block from the “sensing” menu into the first blank in each of the “operators” blocks. Check that “x position” and “tennis ball” (or the ball sprite in your program) are selected in the dropdowns. In both of the second blanks, you’ll refer to the x position of the sprite - the one you’re currently programming. You’ll find the block that gives the x position of the current sprite in “motion” Drag out two of them, and snap them into the two remaining blanks.
Finally, snap “when flag clicked” on the top and test. Okay, wait. The computer is just running away from the ball. It’s going the wrong direction! So the code in the example reads, “if the ball is to the right of the athlete, move left.” Yeah that’s backward.
If that happens to you just pull out the motion blocks and switch them around in the “if” blocks. Great, now watch the computer sprite move in the direction of the ball sprite. If your computer sprite seems to be moving in the wrong direction, you may have switched the conditions in the conditionals.
There is one last bug. Notice that the new sprite constantly flips when it moves back one direction. The forever block checks both “if” conditions very quickly, giving the appearance that both conditions are being met at the same time. This makes the sprite look like its flipping. Fix this by putting a wait block under the second “if” block.
Tinker with this value until you find something that works well for you program. Test it out!
Great job! Once you’re finished, you’ll have programmed a computer opponent with artificial intelligence! Here’s the game plan: Program the computer sprite to forever move to the x position of the ball sprite.
Then, program the computer sprite to detect whether to move left or right, then to move in that direction like the human player.