Making things happen 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 ID: 577246
Download Presentation The PPT/PDF document "Unit 2: Introduction to Coding" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Unit 2: Introduction to Coding
Making things happenSlide2
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.Slide3
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.Slide4
The Storyboard – What
W
e 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.Slide5
The Storyboard – What
W
e 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.Slide6
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.Slide7
The Storyboard – What
W
e 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.Slide8
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.Slide9
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.Slide10
The Storyboard – What
W
e 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.Slide11
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.Slide12
The Storyboard – What
W
e 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.Slide13
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!Slide14
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.