Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unit 2: Introduction to Coding

Similar presentations


Presentation on theme: "Unit 2: Introduction to Coding"— Presentation transcript:

1 Unit 2: Introduction to Coding
Making things happen

2 Tea Party Coding We are going to use the TeaParty 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 OneDrive folder. (Use File-Save As). The file should be saved as TeaParty again.

3 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.

4 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.

5 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.

6 Adding an Audio File Click on this and make sure the Procedures tab is selected. Drag the playAudio 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.

7 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.

8 Making an Object Move Select alice, and drag the moveToward method onto the editor underneath the playAudio method. Select marchHare 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.

9 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 playAudio line and uncheck Is Enabled.

10 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.

11 Making an Object Talk Select alice, and drag the say method onto the editor underneath the moveTo method. Select Custom TextString 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.

12 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.

13 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!

14 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 playAudio 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.


Download ppt "Unit 2: Introduction to Coding"

Similar presentations


Ads by Google