WEBVTT

00:00.000 --> 00:11.720
Welcome back, young coders!

00:11.720 --> 00:17.400
Today, we embark on an even more exciting journey in Scratch, exploring the realms of

00:17.400 --> 00:21.720
conditional statements, variables, and nested loops.

00:21.720 --> 00:27.120
These advanced tools will open up a world of possibilities, allowing you to create intricate

00:27.120 --> 00:29.520
and interactive projects.

00:29.520 --> 00:35.400
Let's dive into the deeper end of coding.

00:35.400 --> 00:40.160
Section 1 Introduction to Advanced Concepts in Scratch

00:40.160 --> 00:45.600
Imagine having the power to make your characters react to different situations or keep track

00:45.600 --> 00:47.560
of scores in a game.

00:47.560 --> 00:52.400
That's what we're about to explore.

00:52.400 --> 00:55.200
Conditional statements Conditional statements are like the

00:55.200 --> 00:57.360
decision-makers in your code.

00:57.360 --> 01:02.840
They can tell your sprite to laugh when clicked or change color when it touches something.

01:02.840 --> 01:06.080
Activity 1 Use Conditional statements

01:06.080 --> 01:13.120
Objective Learn to make your sprite react with if then and if then else blocks.

01:13.120 --> 01:18.120
Steps Choose a sprite, select a character that can show emotions.

01:18.120 --> 01:25.160
Introduce if then block, drag an if then block into your coding area, set up a condition

01:25.440 --> 01:29.040
Attach a when this sprite clicked event.

01:29.040 --> 01:35.480
Add an action, place a say ha ha ha, block inside if then.

01:35.480 --> 01:40.440
Test your code, click your sprite and watch it laugh when clicked.

01:40.440 --> 01:47.640
Explore if then else, replace if then with if then else for more complexity.

01:47.640 --> 01:51.880
Activity 2 Change the color of sprite objective.

01:51.880 --> 01:56.360
Set a project where your sprite changes color upon touching another.

01:56.360 --> 02:01.320
Steps Choose two sprites, let's use a cat and a dog.

02:01.320 --> 02:06.600
Add Conditional statement Use an if then block for the cat sprite.

02:06.600 --> 02:11.520
Set up touching condition, insert a touching dog block.

02:11.520 --> 02:17.920
Add color change action, place a change color effect block inside if then.

02:17.920 --> 02:23.680
Select the interaction, manually move the sprites to see the color change.

02:23.680 --> 02:27.480
Section 2 Understanding variables.

02:27.480 --> 02:31.920
Variables are like little storage boxes in your code holding important information like

02:31.920 --> 02:34.960
scores or counts.

02:34.960 --> 02:41.520
Activity 3 Variables Counting clicks Objective Learn to use variables

02:41.520 --> 02:44.440
by counting clicks on a sprite.

02:44.440 --> 02:49.800
Steps Select a sprite Choose a simple object like a ball, create

02:49.800 --> 02:57.720
a new variable, name it click count, initialize click count, set it to zero at the start.

02:57.720 --> 03:03.080
Increment on click Add change click count by one under a click event.

03:03.080 --> 03:07.920
Display click count, enable its visibility on stage.

03:07.920 --> 03:12.720
Select your click counter, watch the count increase with each click.

03:12.720 --> 03:19.840
Activity 4 Catch the falling star's game objective, create a game using a variable to keep score.

03:19.840 --> 03:25.480
Steps Set up your game Choose a night sky backdrop and a basket sprite.

03:25.480 --> 03:30.640
Initialize score, create and set the score variable to zero.

03:30.640 --> 03:33.880
Add a star sprite, make it fall from the top.

03:33.880 --> 03:40.440
Watch and score, increase score when the basket catches a star, play and refine, adjust

03:40.440 --> 03:44.360
the star's speed and baskets movement.

03:44.360 --> 03:49.560
Nested loops for complex actions Nested loops are like putting a smaller loop inside

03:49.560 --> 03:54.720
a bigger one, creating intricate patterns or repeated actions.

03:54.720 --> 04:01.920
Activity 5 Drawing a flower pattern objective Use nested loops to draw a complex pattern.

04:01.920 --> 04:07.840
Steps Choose a drawing sprite, a simple dot or object works great.

04:07.840 --> 04:15.280
Set up the pen, use pen down to start drawing, create the outer loop, use forever or repeat

04:15.280 --> 04:21.240
for the main pattern, add the inner loop, create a smaller segment of the pattern, design

04:21.240 --> 04:28.120
the pattern, use move and turn blocks for petal shapes, add variation, change the starting

04:28.120 --> 04:31.880
position for each repetition.

04:32.440 --> 04:36.960
Reflect and preview As we wrap up today's lesson, think

04:36.960 --> 04:43.240
about how conditional statements, variables and nested loops add depth to your scratch projects.

04:43.240 --> 04:49.720
They're not just tools, but gateways to endless creativity.

04:49.720 --> 04:53.960
Preview Next lesson Next time, we'll become coding detectives,

04:53.960 --> 04:56.080
solving puzzles and debugging codes.

04:56.080 --> 05:00.280
Get ready to enhance your problem solving skills and uncover the secrets of successful

05:00.280 --> 05:03.280
coding.

05:03.280 --> 05:08.160
Homework Create a new scratch project at home using loops creatively,

05:08.160 --> 05:11.960
whether it's animating a day in your life or a scene from a favorite story, let your

05:11.960 --> 05:16.160
imagination run wild.

05:16.160 --> 05:20.840
Reflection for students Reflect on today's lesson.

05:20.840 --> 05:22.640
What excited you the most?

05:22.640 --> 05:26.840
What new idea are you eager to try in your next scratch project?

05:26.840 --> 05:33.840
Remember, every challenge is a stepping stone to becoming a better coder.

