Unit 2 Introduction to Coding MAKING THINGS HAPPEN

  • Slides: 14
Download presentation
Unit 2: Introduction to Coding MAKING THINGS HAPPEN

Unit 2: Introduction to Coding MAKING THINGS HAPPEN

Tea Party Coding We are going to use the Tea. Party scene that you

Tea Party Coding We are going to use the Tea. Party scene that you created for the last unit. Open the file from either the “Recent” or “File System” tab. Save a new version of this file in a new “Unit 2” folder in your Computer Science One. Drive folder. (Use File. Save As). The file should be saved as Tea. Party again.

Comments Drag the //comment block to the editor and enter your name, date, and

Comments Drag the //comment block to the editor and enter your name, date, and a description of the program. You should do this for all of your programs from now on.

The Storyboard – What We Want to Happen Scene opens with the Mad Hatter

The Storyboard – What We Want to Happen Scene opens with the Mad Hatter and the March Hare gathered around a table with tea and birthday cake. The unbirthday song plays. Alice approaches the table. Alice tells the characters that she enjoyed their singing. They tell her that nobody ever compliments their singing and insist that she has a cup of tea. She apologizes for interrupting their birthday party. They explain that it isn’t their birthday; it is their “unbirthday”. Alice then asks them to explain an “unbirthday”. They then tell her that everyone has 364 “unbirthdays” each year. Alice realizes that it is her “unbirthday” too.

The Storyboard – What We Want to Happen Scene opens with the Mad Hatter

The Storyboard – What We Want to Happen Scene opens with the Mad Hatter and the March Hare gathered around a table with tea and birthday cake. The unbirthday song plays. Alice approaches the table. Alice tells the characters that she enjoyed their singing. They tell her that nobody ever compliments their singing and insist that she has a cup of tea. She apologizes for interrupting their birthday party. They explain that it isn’t their birthday; it is their “unbirthday”. Alice then asks them to explain an “unbirthday”. They then tell her that everyone has 364 “unbirthdays” each year. Alice realizes that it is her “unbirthday” too.

Adding an Audio File Click on this and make sure the Procedures tab is

Adding an Audio File Click on this and make sure the Procedures tab is selected. Drag the play. Audio method to the editor. Select Import Audio and use the Unbirthday Song file that you should have saved to your Unit 2 folder. By using this procedural method on “this” scene, we are telling the scene to play the song. Test the program by clicking the Run button. The song should play.

The Storyboard – What We Want to Happen Scene opens with the Mad Hatter

The Storyboard – What We Want to Happen Scene opens with the Mad Hatter and the March Hare gathered around a table with tea and birthday cake. The unbirthday song plays. Alice approaches the table. Alice tells the characters that she enjoyed their singing. They tell her that nobody ever compliments their singing and insist that she has a cup of tea. She apologizes for interrupting their birthday party. They explain that it isn’t their birthday; it is their “unbirthday”. Alice then asks them to explain an “unbirthday”. They then tell her that everyone has 364 “unbirthdays” each year. Alice realizes that it is her “unbirthday” too.

Making an Object Move Select alice, and drag the move. Toward method onto the

Making an Object Move Select alice, and drag the move. Toward method onto the editor underneath the play. Audio method. Select march. Hare as the target and 2. 0 as the amount. Run the program. Alice should move when the song is finished. The program happens in order. The next line won’t start until the line before is finished.

Disabling the Song Since its already getting really old hearing that song, let’s disable

Disabling the Song Since its already getting really old hearing that song, let’s disable that line of code. We can enable it later. Right click on the play. Audio line and uncheck Is Enabled.

The Storyboard – What We Want to Happen Scene opens with the Mad Hatter

The Storyboard – What We Want to Happen Scene opens with the Mad Hatter and the March Hare gathered around a table with tea and birthday cake. The unbirthday song plays. Alice approaches the table. Alice tells the characters that she enjoyed their singing. They tell her that nobody ever compliments their singing and insist that she has a cup of tea. She apologizes for interrupting their birthday party. They explain that it isn’t their birthday; it is their “unbirthday”. Alice then asks them to explain an “unbirthday”. They then tell her that everyone has 364 “unbirthdays” each year. Alice realizes that it is her “unbirthday” too.

Making an Object Talk Select alice, and drag the say method onto the editor

Making an Object Talk Select alice, and drag the say method onto the editor underneath the move. To method. Select Custom Text. String and then enter “I enjoyed your singing”. You can select add detail if you want to change the look or the duration that the bubble stays on the screen.

The Storyboard – What We Want to Happen Scene opens with the Mad Hatter

The Storyboard – What We Want to Happen Scene opens with the Mad Hatter and the March Hare gathered around a table with tea and birthday cake. The unbirthday song plays. Alice approaches the table. Alice tells the characters that she enjoyed their singing. They tell her that nobody ever compliments their singing and insist that she has a cup of tea. She apologizes for interrupting their birthday party. They explain that it isn’t their birthday; it is their “unbirthday”. Alice then asks them to explain an “unbirthday”. They then tell her that everyone has 364 “unbirthdays” each year. Alice realizes that it is her “unbirthday” too.

Making an Object Talk Now you try! Make the characters have the following dialog.

Making an Object Talk Now you try! Make the characters have the following dialog. You may want some of the longer statements to have a longer duration, or break them into parts. Mad Hatter – We never get compliments. You must have a cup of tea! Alice – Sorry for interrupting your birthday party. March Hare – The is not a birthday party. This is an unbirthday. Alice – Unbirthday? Mad Hatter – Statistics prove, prove that you’ve got one birthday. One birthday every year, but there are 364 unbirthdays. That’s exactly why we are gathered here to cheer. Alice – Well I guess it’s my unbirthday too!

Final Details Make Alice jump up and down a few times at the end.

Final Details Make Alice jump up and down a few times at the end. Hint: You want her to move up and down. Adjust the durations if you want her to jump faster. When the rest of the program is how you want it, enable the play. Audio method to make the song play. Challenge: Make the Mad Hatter and the March Hare dance to the song. You may need to explore the Do Together, Do In Order, and Count blocks to make the dancing happen at the same time as the song.