Scratch Programming - Learn Scratch 3.0 by Creating PacMan, Arkanoid, a Game with Elsa & the Lovebug | Dr. Chris Mall 30,000+ Students | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Scratch Programming - Learn Scratch 3.0 by Creating PacMan, Arkanoid, a Game with Elsa & the Lovebug

teacher avatar Dr. Chris Mall 30,000+ Students, C# | Flutter | Scratch Instructor

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

21 Lessons (2h 38m)
    • 1. Welcome to Scratch 3.0 & How It All Works

      2:03
    • 2. Introducing the Great Pac-Man in Scratch 3.0

      1:05
    • 3. Coding Pac-Man in Scratch 3.0

      17:36
    • 4. Coding the Dots

      4:34
    • 5. Coding the Ghosts

      8:14
    • 6. Coding the Messages and Finalizing Pac-Man

      11:38
    • 7. Introducing the game "A Lovebug in my Plate"

      5:15
    • 8. Coding the "Ready" Event

      8:52
    • 9. Coding the "Start" Event

      12:14
    • 10. Coding the "Take" Event

      5:28
    • 11. Coding the Lovebug

      11:44
    • 12. Testing and Finishing the Lovebug Game in Scratch 3.0

      8:39
    • 13. Introducing the Great Arkanoid Game

      1:00
    • 14. Creating the Background and the Sprites

      9:01
    • 15. Coding the Paddle, the Ball and the Messages

      5:28
    • 16. Creating the Bricks

      8:34
    • 17. Finalizing the Game and some Minor Improvements

      4:42
    • 18. Introducing Elsa and What We Will Create

      1:51
    • 19. Coding Elsa's Movements

      5:55
    • 20. Coding Elsa's Questions

      15:12
    • 21. Finalizing the Game and some Minor Improvements

      9:11
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

231

Students

--

Projects

About This Class

In this course you will be able to develop 3 very beloved games like the Pac-Man, the Arkanoid, the absolute block-breaker game, a wonderful game with princess Elsa and the funny game "A Lovebug eats fruits in my plate" in Scratch programming language. For the development of these games, is used Scratch because is an educational programming environment that is has an easy graphical interface that it will allow us to drag and drop the right blocks of coding.

I promise you that it will be a funny and exciting course that it will motivate you to learn coding in more depth.

Scratch 3.0 is a free programming language and online community where you can create your own interactive stories, games, and animations. Using Scratch, users can create online projects and develop them into almost anything by using a simple block-like interface. When they are ready, they then share, and also discuss their creations with each other. Scratch was developed by the Lifelong Kindergarten group at the MIT Media Lab. Scratch is designed to help children (ages 8 and up) learn to utilize their imaginations, practice common sense, and, most importantly, to interact with computers.

Scratch is the best educational programming software for kids available today. With Scratch, you can create games and interactive art projects all while having lots of fun!

This course uses the amazing Scratch program developed by MIT to teach coding this course is meant for:

- Everybody that is interested in learning to code, from kids to adults,  Scratch was developed by MIT to teach people to code. It is the best way to learn to code that I have been aware of in my lifetime.

- Anyone interested in teaching beginning programming as a career or business.  Teaching kids to code is becoming big business.  Want to start your own coding academy school or get a position as an instructor?  They all use Scratch programming, learn Scratch here from a University programming instructor.

- Anyone that already knows how to code that wants to learn from Scratch Programming and build some fun games. Why did we get into programming in the first place? Because its fun and Scratch is super fun!  No matter your level, you will have fun and learn from Scratch.  I know I did and that is what the people at MIT intended.

Meet Your Teacher

Teacher Profile Image

Dr. Chris Mall 30,000+ Students

C# | Flutter | Scratch Instructor

Teacher

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Welcome to Scratch 3.0 & How It All Works: The programmers of tomorrow are the Wizards of the future. It's the closest thing you can get to shove magic power does 21st century according to gave new L. So welcome to this scratch 3 masterclass. Let's start creating gains, learning, coding, and having fun together. My name is Chris and I arguably you through this course, I hold a PhD in educational development and I really loved games and scratch. I have more than 30 thousand students worldwide antigenic guarantee that Scratch is a great language to learn. So what will you learn in this course? You will learn how to program with screenshots, how to think by acquiring computational thinking, how to solve problems with algorithmic logic, how to design and how to develop, and how to finalize and share your game with a detailed three-step process and step-by-step examples. So we will design together great farming and excited games. And I will teach you step-by-step how to think, how to design and how to develop your own successful games. Let's see together some of these wonderful games. Games like the great Pacman or the arc annoyed the Absolute locke breaker game, or how to create a really funny, it's addictive game, like the love back in my plate. So try to eat the fruits to get points, you have 15 seconds for rich fruit. So I designed this course for random, who wants to CFCs kids learn to code with Scratch or who wants to create impressive games easily. By the end of this course, you will be able to develop your own games, sealed them, and serve them with your family and your friends. So VI deal student of this course is anyone who is looking to improve the skills in creating games or students that want to learn coding with sprouts and make magic things happen. 2. Introducing the Great Pac-Man in Scratch 3.0: Hey guys, welcome back. Now in this lesson, we will create a simplified version of Pac-Man. Batman is a really great game that was one of the most popular games in the eighties. It is a retro game where the player controls Pacman with polymers character through this enclosed maze. The objective of the game is to eat all the dots placed in the maze, while you should avoid that for colored ghosts right here. So if PacMan makes contact with the ghosts, then she will lose alive. The game ends when all lives are lost. So it's, of the forgoes, has its own unique intelligence, unique personality. You should eat all these dots and avoid the ghosts to win the game, we will start creating this game right now. 3. Coding Pac-Man in Scratch 3.0: So first of all, you will see that we have sprite to one right here. I will name it pacman. So here is my main hero. Here is the Pac-Man. And I have all these dots there are, as you will see there 69 dots. And then we have got one goes to, goes three goes for. We will start right now coding our pacman. So we will tell that if the flag is clicked, then forever, forever go to Control forever. We would like to change the costume. You will see that Pacman says to costumes, costumes, one, custom three. So open your mouth, close the mouth. Open the mouth, close the mouth. So this is what we are going to do forever. Suites costume, go to Looks, and then Streets cost him two costumes. One. Then wait. Go to the control weight, 0.2 seconds, and then go to this category. Suites, cause him again, to cause him three. And again wait for 0.2 seconds. So go to Control and weight is 0.2 seconds. So let's take now the flag. And here it is, my Blackman helping the mouth close the mouth and the mouth close the mouth. Ok. It is very good. Now go again. When the flag is clicked, I would like to go right here where it is right now. So go to the motion. Go to x and y, as you will see, X and Y right now is five for x as it is here, you can see it. And it is y minus 75. So it's time. I click the flag. I will take it right here. It's time you click the flag. Pacman will go right here and we'll start opening and closing she's mouth. So then I will have three lives. So I would like to go to the variables. And here you will see that there are some variables that will help me in the game. I have three lives and also I use variable for the score. We'll use a variable if I win the game, if unless the game, what is the game type? So if the game type is on, I will have a variable for the game types. So it will take value one, for example, and it's time. The Pac-Man eats a dot, then the score will be increased and some other things. So I'll need a variable for the IIT. So go to x and y as quotes. And I would like to set the lives to three. So set sends it to lives to three. So it's time we starting in game. Lives could go to three, then go to the control. And I would like to repeat until so fine this block repeat until, repeat until lives. The variable lives is 0. So I need lives and I need also the operators. So take the equal when lives is 0, drag it and drop it right here. When repeat until alive 0, because when lives will be 0, then it will be GameOver. So here we want an if statement to check if we have a game over. I will go to the control. I will take the 0f. If then statement, I will go to the operators. I will take the end. Because the first value will be if w0 is equal to 0, which means that I lost. So go to variables, take the wind variable. And I will also need an operator to be equal. So if w0 is equal to 0, and I will drag it and drop it right here. And then I would like to say that if when is equal to 0 or if Pac-Man is being touched by one of the four ghosts. So I also need, and I only need 123 operators. So gushed one goes to, goes three goes for, I will go to the sensing and take this one touching m here, 2s. The ghost one. If dancing goes, one, very good. Here we are. If that sink no here. And drag, drag and drop it right here. And then this friend, be careful right here. Goes to if that thing ghost three. And if that seeing ghosts for we will take this one, drag it, and drop it right here. Then go to variables. Set it to 0 so that this means that Pacman cannot continue eating dots. So set it to 0. Saint lives by minus1, saint lives by minus one. So we will go to the sound. And here you will see that there is sound play sound, Pacman, deaf. And I will drag it and drop it right here. So saint lives by minus1, play sound, Pac-Man, deaf until done. And then go again to this position. So go to Motion and Drag and drop this run, play sound and go again to the initial position. So go to x five, y minus 75. And then we will go on, go to the control and SEC again. If the game type is equal to one. So if go to the operators, we will need the equals sign. Keep it right here for now. If game type is equal to one and i mean an end to the operator, well, for game types should be checked. If it's equal to one. If variables lose is equal to 0. So go to Operators equal to 0. And I made a third operator right here. So drag it and drop it right here. I need to check if w0 is equal to 0. So go to variables, take the wind variable, and also go to operators. Take the equal when is equal to 0, drag it and drop it right here. Drug ok, and take all this one right here. So if the game type is equal to one and lose is equal to 0, and when is equal to 0, then I need to check if the color that Pac-Man is starting is the black one and the red color is not touching the green one. So let's see right now. So I'm going to control, I will need an if statement, drag and drop it right here. And then I will need an ENT operator, dragged and dropped it and inside the end, drag and drop the NOT operator. So i will take, go to sensing if Pac-Man is touching the black color. So take this color right here. Click right here, and then be careful this dot right here, I need the color of this dot right here. Here we are. If PacMan with this dot, with his mouth, this dot right here is touching the black color. So click right here again. Click this one, and be careful, I need the black color. So very good. And I will change this brightness to 0 to be sure that here it is, the black color and not, not. Drag and drop it right here again. And not click right here. Click right here, and tiny this color right here. Be careful from this line. I need this color. So. Is touching and I need again click right here, and I will need again the dot from the mouth of the Bankman. So here we are. Now the colors are ready. So if Pac-Man is starting the black color, I need Pac-Man to move three steps because Pac-Man always moves. So drag it and drop it right here and move three steps. Very, very good. And then if I go to the Control, if be careful. This if soon-to-be below the previous if Serbia inside this run, this if game time to be equal with one and lose equal to 0 and when equal to 0. So here it is, the second if statement. And go to the sensing if key, not space but up arrow is pressed, then st the direction, so go to Motion and point in direction. And here 2s the up direction, point direction 0. Very, very good. I will WK To this. Right-click, click Duplicate, and be careful instantly after the previous ifStatement taints the up-arrow to the down arrow and the direction to down right here, 180. And then I will do obligated in yen right here. If t right arrow is pressed, point direction, right here. And then again, duplicate this room. If key, left arrow is pressed, the direction in the left direction mine minus 90. Very, very good. And I need one more thing, because here we have a kind of a teleport. So if Pacman goes right here, it should be appeared right here, it should be sewn right here. And if it goes right here, it should be shown from the opposite side. So I will need again the ifStatement. Go to the Control. If statement, be careful right here. It will be instantly after the previous if statement. If go to the sensing, if touching color, click right here, and I will need. This color. Ok, so if it adds is the scholar, I need to go from the opposite side right here. So I need Pacman bout right here. I will write x 2102 Y to be about minus ten, for example. So go to the motion, go to x minus x 210, and y minus ten, and then move ten steps. Move ten steps, then again to the if statement, dragged and dropped. Be careful right here. And if go to the sensing, if that's in color. And now click here, click right here, right here. If that's encountered, this one, then go from the opposite side. Go about right here. So go to the Mohsen, take the x and the y, and move ten steps. Very, very good. Now let's see what we have done until now. Click to the flag. Mmm, here we are. And it doesn't do anything because, because the game type is not equal to one and clues and when doesn't have values. So we should go to the backdrop. Click right here to the backdrop. Then here we have the code of the backdrop. So we will click to the events when the flag is clicked, initialize our variables. So set it to 0, set game type 20. Set score to 0. Then we will create a sound. Start, Start sound. Not Pac-Man, Ms. Pacman beginning right here. And then to wait, go to the control to wait for about four seconds. Then I need to broadcast a message that the game starts. And these methods, Serbia in the events broadcasts the methods. Broadcast a new methods. Start eating dots. This is the method start eating dots. Wait for about 1 second. So go to the Control, wait 1 second. And then set, go to variables, set the game type to one. So the game starts. Now, click to this flag. And here I will unmute m here, these Pacman, Of course, he cannot eat anything, but I can move back one. Very good, very, very good. 4. Coding the Dots: So now let's go on and start coding the dots. So D21. I will go to the events. And two, when I receive, my methods are when I receive start eating dots. Then first of all, go to Looks and I would like to be sold. I would like to show this dot there. Go to the control. Take the forever and forever. If, if, take the if statement, go to the sensing. If touching Pac-Man then broadcasts a message that it was eaten. So go to the events, broadcast. New messages, eaten. It was eaten. And go to Luke's drag and drop the Height variable. So broadcasts that it was eaten and hide the dot one. Then go to variables and save the score by one. Score should be increased. So change the score by one and then stop the script. So go to the control and stop this script. Drag and drop right here nonstop, all stop. Does the script. Be careful? Now, I would like to take this, click once in this block and then type control C, control. And c, you should have control being pressed. And see as you do copy. Now we have copied this block. Go to dot two and press Control. And with pressed control also press V. So control V to paste these commands, this script now go to dot three, again, control v, goto dot for control V. Then No.5, Control V, 0.6s, Control V dot seven. That aid the nine. Very good. The ten dots 11, Control V control, V control V dot 1516171819. To all the dots. You should. If you wander, which dot is this one? If you double-click to dot 25, you will see that this one will start blinking. So this is the one that I want control V again, go on with the script. All the dots would have exactly the same script. So just control V. Paste this script to all fit dots. But 40, forty one, forty two, forty three, forty four forty five, control V control V Control-V console V control vehicle on the movie. Again, again, again. Sixty one, sixty two, sixty nine. Very good. Now the dots are ready. Let's click to the flag to see. Okay, now, as you can say, that score is being increased. Very good. 5. Coding the Ghosts: So let's go to the ghosts to code goes to one. Right now. I will go to the events and drag and drop right here the flag, when the flag is clicked, go to Motion and go to x and y where it is right now. Then wait for 1 second, go to the Control, wait for 1 second, and then wait until the game type is equal to n when the game starts. So wait until go to operators. Take the equal operator. When go to variables. Game type is equal to one. Then we want to set the rotation style to don't rotate. So go to Mohsen. And right here, take the set rotation style to don't rotate. Set rotation style from the motion categories set recession style to don't rotate and to point go up, point indirection. We would like to point v up direction so that it could go outside the door. So point in 0. And then we would like to repeat. Go to Control, repeat 2020 times to move. Motion, move for about 2.5 steps, then saying that direction, point in direction minus 90, the left one. And repeat, go to the control, repeat 32 times, because we have about 32 blocks and go to motion, move again, 2.5 steps. Now, I will take this code, I will duplicate it, drag it and drop it right here. I will change the direction to 180, right here. Repeat 32. I will send it to repeat 49 because you will see that there are more steps right here. Repeat 39, and move 2.5. steps. Now, I would like to repeat all the time. So go to Control. Repeat until the game is over. So repeat until DOE to the operators. Take the equal sign. Score is equal to 69. So go to variables. Take the score, variable score is equal to 69. Go to Motion and drag and drop point indirection minus 90. And now I will try to duplicate this. I will take again, I'll go to the control. I will take the repeat. I will use repeated 50 times. Motion. Move again, 2.5. steps. Very good. And chains again the direction. So go to the looks, Go to the motion point indirection 180. Now I will duplicate it again, drag it and drop it here. I want to repeat again 32 times as I did before. And point in direction 90, right here. And then I would like to duplicate again. All these things. Be careful right here. And after the 90, I repeat 17. Move 2.5. steps then point in direction 0. Then repeat again, 17, then point in direction 90. Then I want to take this one to debilitated. So so I will take all this block. Wj did drag it. No, no, no, no, no. Bracket and drop it right here. So repeat 17, move 2.5. steps point in direction 90. Now repeat thirty-three. Point indirection again 90, again, repeat 33 direction 0, then repeat 18 in direction 90, don't change anything. So then repeat 32 in direction 180. Then point, repeat 17 in direction 90. So it is a 189. Then 0, repeat 17 direction 0. So I believe that you have based on the pattern 180900. Then again, it will be so it is in the bottom right in the app. Now, if it should be in the left, so here it is up, and here it will be in the left. So tens 0 then repeat 32 and minus 90. And then repeat one last time, 114. And move 2.5 steps and drag and drop right here, this one, all these commands drag it and drop it after the point in direction minus 990. And inside the repeat until score is equal to 69. So dragging a drop it right here. No, no, no. Right. Drag it and drop it. Right here. Exactly. So here it is. The repeat until is right here, then point direction, repeat, and all the other commands. Very good. I will click again. I will click right here. So as you see, this, commands are blurred. Control C again, control with pest control type. Press C, go to, goes to and Control V, go to, goes three, and Control V, go to, goes for, and Control V. Very, very good. 6. Coding the Messages and Finalizing Pac-Man: Now finally, we will need two messages. One should be the winning methods and the others be the GameOver methods. So I will go right here to create a methods and toggle right, dry again. Game over. I will change the size, drag it from the upper right or the bottom right corner. I will also change the color. Okay. I like it. Try again. Game over. Very good. I would say in spite 12, game came over and tag, we'll create another one. Paint. Well done. You know, I would send the message to Congress. Should change regulations. You want well done. And I will also change this one to pick your run. Be careful. It should be shown. So not too big. Well that's relations. You want. Very good. Perfect. I want it right here. So go again to the game over, go to the code, and now we will code the game over methods. Go to events when the flag is clicked. Go to the variables, set loose to 0, set the loop variable to 0, then go to Looks and hide the message. Then wait, go to the control weight for about five seconds. Then go to their control again and wait until lives are equal to 0. So go to the operators, take the equals sign, sends 520, and then go to variables and drag and drop the variable lives. Wait until lives are recalled to 0, then set game type to 0. Game stops. Then set loose to one, set loose variable to one. So the methods, so go to Looks and drag-and-drop the so variable, Go to the control and wait three seconds. Go to the variables set when 20, set when variable to 0, and stop everything. So go to the control and take the stop all command right here. Now go to the winning methods, change sprite 12 winning methods with tablets. Winning methods go to the events when flag is clicked. Then go to variables set when to 0. Before we did the loose. Now we'll do the win. Again, go to Looks and hide. The methods, go to their control and wait until score is equal to 69 because we have 69 dots. So go to the operators. Take the equals sign, saint 50 to 69, go to variables, take the score dragged and dropped right here. So wait until score is equal to 69. Then set the game type 20 was we did before. The game stops, set when 2-1. So, so go to the Looks category, take the show command, drag and drop it right here. And I wanted to sound, so play sound, play, sound, play this one, and stop everything, go to the control. And stop. All. Very, very good. Now let's see, the game clicked to the flag. M here it starts. Warps. Oops. Very good. But we have one problem. Whichever one problem. And the problem is that all the ghosts go exactly the same way. So I should click Stop. The chains would be that in Ghost one until n goes to I have the same initial direction minus 90. So I will go to, goes to one and I will change direction. So if one goes left, I want this to go right. So this is the initial direction, they go up. Then the first one we'll go left, the second one will go right. Then I want the third one to go left again, while the other one to be at the bottom. And again to change. So the first one should have after than 180 minus 90. So in the third one, I will drag and drop only the repeat until right here. I will take it off this one. And in Ghost four, also, I will drag and drop this run, drag it right here, and that will change this to 180. Very good. And also in cost three, I will change this direction to 180. Okay, I will change the score two sixty eight. Sixty eight. And also aggregate two goes to four. And I will point in direction 180. Very good. I didn't see ghost one, so goes to one. I will change this. So let's try again. I, c goes four, because four is a K. Now it's ghost. One goes to, I will double-click here. This goes. So goes three is not shown, goes free is not shown as should make attains. Two goes to three. I will stop the game. Goes three is not shown. I will change the direction here to 90. We should change this reputational score is 68. Repeat until score is sixty eight. Sixty eight sixty eight. Saying this one to 68. So here it goes three, which had a mistake. We don't need to repeat until. So take this friend point indirection right here and drag and drop it out. We need only one repeat until 68. Go to, goes to repeat until 68. Also, here, it is not wrong to have a second one. Repeat until score is 68, because they both will stop when score is 68. But I will drag it and drop it right here. Now go to, goes to one, again, the same stake. Drag it and drop it right here. The score should be 68. So score sixty eight, sixty eight, sixty eight, sixty eight. Very good. Go to the winning methods. Saints, the score to 68. Very good. Let's try again. Okay, here are the ghosts. Here are the forecasts. Very difficult. I will try to go up 4142. Take this and take this one, take all these. So this is the light version of Pac-Man. We have only dots, which we did. Only the dots would not have any superpowers. We can't eat the ghosts. We just need to eat all the dots. Congratulations, you won. Thank you very much. And let's try to lose right now. I will go to the gods. Know. Not Again. I lost three times. So try again, GameOver. This was the live version of Pacman. I hope that you liked it. So be careful you can download the initial version of Pac-Man, create the core with me, and try to download if you have any problems, the complete version of the Pac-Man, or ask me whatever you might want. So feel free to ask me whatever we want and I'm looking forward to seeing you in the next game. 13. Introducing the Great Arkanoid Game: Hey guys, welcome back. Now we will build together my favorite game. And this game is VR catenoid game. Or can know it is. A very popular game, is a retro game, is a block breaker arcade game published in North America about 35 years go. The player controls this battle, which prevents the ball from falling from the playing field. And it's time attempts to bounce the ball against and number of bricks. So the ball striking a brick goes as the brick to disappear. When all the bricks are gun, then the player advances to the next level, or he takes the weaning methods, as in our game that we will create later. So there are many game variations and we will try to create a one version right now from scratch. We will do not need anything. 14. Creating the Background and the Sprites: So I'm going to create a blank game right here, File New. And here we are. We have a blank new Scratch project. I will name it. Are carotenoid and 3 because it will be built in Scratch 3, I will delete this cat, so pi will go right here and click this grasping. I would like to use a black backdrop. A black backdrop with stars, like being in the space somewhere. So I will go right here, choose a backdrop, painted backdrop. This is what I want. And right here I will go and use this one. And I will paint it in black color. So brightness 0, saturation 0, color 0. Convert to bitmap. And click right here, and here we are. Now I could go into this circle, colour 48 and saturation 0 and full brightness. So I have a white color. So click right here, go back, convert two vector. And I will change this brass to three. And here I will paint some stars. So you can paint as many stars as you would like. We can also paint some bigger stars. So choose for example, five. Here are some bigger stars. Now it's okay. So this is my backdrop. I will go back to the code. Very good. This is my backdrop. And now I would like to create, to paint a sprite from the sprites, but I will paint, I will paint right here. I want this one, this rectangle, to have a solid color. So I will change this to this run 205100 and outline. I don't want an outline. So choose this rectangle. Go to fill color 20, saturation 50, brightness. And you can see it right here. Okay? And this one, the solid one, the first one. So colored 20 saturation, 50 brightness, one candidate. And here we are. It is very, very big. So it is a k because we can go back here and change the size, as you can see. So I could change it to 70. Now it is perfect. And I will go right here. I think it is. Okay now. So I will name it. But do go here and I will name it paddle. This is my main paddle. And now I will create some smaller bricks that i will hit them with my bowl. I will go back here to the sprite. I will paint a sprite. And this time I will use something like more gray. This is good. This is good. So go to color 50. Color 50, saturation 12, brightness 100, I believe it's okay. And let's create a brick right here. I think it's OK, this brick. So right here, or maybe a little bit thinner. This is very good. This is very good. Be careful if you have two small bricks than your game will be more difficult to break the bricks. So this is one brick. I will go back to code and I will rename it to break. One. Very good. And then I go right-click to require and Aigul W gated. Very good. I will duplicate it. So you will see brick, brick to break three. I will duplicate it. Break for very good. I will duplicate it. Break five. Again. Brick six, brick seven, brick eight, brick nine. I think nine bricks is okay. And you can place them randomly in your screen. Something like this. Very good. If you would like to have your bricks aligned, you can always take the x and the y. So for example, brick eight, bricks seven, brigade brick nine, have about the same way. So I go to 15. Okay. And this one brick five, also 15. And this one double-click required. It's keV. Why about 62 K? This one also 60, it's brick four. And this one also 60 is required. This one double-click brick 90. I will do this. Minus 35. This one double-click minus 35 and vision minus 35. I will also change the x to be 200 and a little bit more left. This one to be a little bit more left. And to this one little bit more left. And I believe that now JK, It doesn't matter if it is placed somewhere else. I believe it's again, very good. So now we have nine bricks, We have a battle, and we also need a bowl. So you can choose a sprite. You can choose a bowl. This is very good ball. I want this ball mats smaller. I would send the size to 40. So now does okay. And now we are ready to start coding our arc annoyed. But before starting, I will also need to messages the game over and the game one methods. So first of all, I will need the GameOver. So I will paint right here. And I want a game over. I will choose this color right here. Gameover, very good. Gameover. I want, I will choose this one, the Curlin. I like it. So here it is, the game over. We will need this GameOver when the game is over. So we'll replace somewhere like here, and also a new one that I will name it, Game one. And I will write, you are a great layer. You want. I wanted months bigger right here. And this is my winning methods. Very good. Now, I will name the sprite one game over. And this pride to game one. Very good. Now I think I am ready to start creating my script. 15. Coding the Paddle, the Ball and the Messages: Hey guys, welcome back. Now we will start together with these two methods, Game Over and game won't. I would like to go to the events and I will say, be careful, I have already clicked game one methods. So I will drag and drop right here to the game one script. When flag is clicked, then go to Looks category and choose Hide. So when the flag is clicked, it will be hidden. So I will create exactly the same to the game over script right here. Go to the events. When flag is clicked, Looks category, and click Hide. So when flag is clicked, then hide and also GameOver is hidden. I will go to the ball. So the ball right here. And I will start creating the script for my bow. I will go to the events. When flag is clicked. Then I would like to go right here, that is right now about the center of the screen right here. So go to the Motion category and drag and drop it right here. So you will see that x and y has exactly the same values that is right now in the screen. X minus1, y minus 36. Very good. I would like to turn left 15 degrees so that its time, it will start changing the orientation of the ball. And then I would like to do some things forever. So go to the control and click forever. Then go to motion. Move five steps. And then act like to say to the bowl that if you are on end, then bounds, I will go to monsoon. And I will choose if on edge bounce. So let's click to this flag to see what we have done until now. As you will see, very good. Of course, when it hits the bricks, nothing happens because men say to do anything. So this is good for now. I will go back to my paddle and I will start coding my paddle right now. So I will say, when flag is clicked, then go where you are right now. So go to Monsoon, go to x 12, Y minus 186 were good. And then go to the Control. Drag and drop forever, forever. I would like to set the x2 mouse X. So go to sensing and I will need this run mouse X, go to the motion. And I will use the set X to, but I will drag and drop mouse X. So let's see what will happen now, my paddle, I clicked to the flag and as you can see, I can move my paddle right and left. Now, we'd like to say that when my bow hits my paddle, it should chains also direction. So go back to the wall. And I will use the control. If it is, go to the sensing. If that's Inc. And here I will click to paddle. If touching paddle, then I would like to point in another direction. So go to Motion, point indirection. And I would like to use exactly the opposite direction. So I will go to the operators and I will use the 180. So 180 is exactly the same direction. But to use the opposite direction, you need to subtract from 180 the direction that you are right now. So go to Motion and take the direction 180 minus direction. And this one, I would drag and drop it right here. So let's see what we did right now. Here is my ball up. As you can see, when it hit my paddle, it changes direction. Very good. 16. Creating the Bricks: Now I would like to do one more thing I will do. I would like to create the game over. So what do I do right now is actually I will create a deadline right here. And when my ball touches this deadline, this means that it will be the game over. So I will create to paint again, painting New sprite. I will choose again the same right here, rectangle. I will use another color, maybe a blue one. Something like this. So color 70, saturation 15, and brightness 100. This is a good color. And I will create a very, very thin line right here. Be careful. It should be a long line. It should be right here in the bottom of your screen. As you can see, it is very good right here. When my ball hits this line, the game over line. So I will go to the sprite, I will name it deadline, then the game will GameOver. So I will go back to the ball. And I will again use the if code. Go to the events, go to the control. Be careful. Statements should be outside from the previous one. So if the ball that is so go to sensing. If that is if that think the deadline. Then I would like to broadcast a message, to broadcast a GameOver methods and stop everything. So I will go to the events and I go use this command, broadcast. Message1 aggregates this message when entering new methods. I will name it game over methods. Broadcast game over n, stop everything. So go to the control and stop or so, if that is the line, it will broadcast game over and it will stop everything. It will stop everything and the GameOver methods should be sown. So go to game over and click. When I receive game over goes the events. When I receive game over. Then it should be shown, go to Looks category and drag and drop the. So let's see what we did right now. Very good to this. My bow. And I will try to lose. My line, hit my deadline. Game over Methods appeared very, very good. So I think that is everything OK with my paddle with bald eagle, go to BRC one. And I will start coding the bricks. So I will go to the events. When flag is clicked, I would like to be sown. So go to the Looks category and click right here. So then act like to use the forever command. So go to the control and click forever, drag it and drop it right here. And forever it will take if it touches the ball. So take the command if drag it and drop it right here. If go to sensing it, that is. So take the command touching bracket and drop it if that think the ball. So try to find the ball. Here it is. If touching the ball, then it should be hidden. So go to Looks and hide it. Very, very good. So it is disappeared. But I would like also to have something like a score, my game. So I will hide it and I will broadcast a message. I will broadcast a heat methods. So go to events and broadcast a new message is not a game over methods, but heat methods. Very good. And then I will change the score by one. But first of all, we should go to the variables and create a new variable that I will name it, score. So score, it is for all sprites. Ok. Score is now 0, as you can see. So I would like to change the score by one, change score by one. And here you have 123456789. So if the score is nine, then it's broadcast. Game one. So go to the events. If drag and drop it right here after the change, score by one, go to the operators, take the equal and drop it right here. If the score is equal to nine as a hidden line bricks, so the maximum score will be nine. So go to variables, take the score variable and drag and drop it right here. If score is equal to nine, then broadcast game won. So we want a new methods go to events and broadcast a new message right here. Game one. And as we did exactly as we did in the game over, we will go to the game won methods and click it right here and drag and drop. When I receive nor GameOver, game one, go to Looks category and drag and drop the show command right here. Very good. Then go back to BRC. One. Here is my script. It is a good script. I will drag the script and drop it to break too. And if you click to break two, you will see that now BRCA1 and BRCA2 have exactly the same command. So you do not need to create again the same command. Also take it, drag it and drop it to break three. And drag it and drop it to break four. To break five. To break form. Rather than lobby to break five. Very good. To brick seeks to break seven to every break. So every brick has exactly the same scripts. We should go back to our ball right here and click to the events so that when our ball receive the heat methods, it should point in the opposite direction. So we need exactly this command. You can right-click, duplicate and drag it and drop it right here. So. 17. Finalizing the Game and some Minor Improvements: Now let's see what we have done until now. Score one, very good score to. Everything seems fine. Score 34567. And game over. I immigrate bilayer i1. If you would like to stop everything. The game one, we go back to the game one and after the so we will use the stop everything. So go to the control, stop, all end right here. Now we will do a small addition of small improvement that it will make our game even better. I will go to rebel. And here as we can see, when it receives heat, it points in different direction. I would like to change this forever moved five steps. If you, for example, change it to ten steps, you will see that the game is much more difficult because the ball goes very fast. So act like it's time we hit a brick. I would like to change the speed of the ball. So I will go to the variables and I will create a new variable. I will name it speed of the ball. This is a new variable for all sprites. Go to operators and click here the plus symbol. So it will be, it will always be what the value of the variable speed of the ball is, plus five steps. And I will drag and drop it right here. So the speed of the ball will be increased. Its time, it receives a heat. So go to variables and change the score, the speed of the ball variable by one. So set the speed of the ball to 0 initially when it starts the game, but it's time, it receives a message. It will change the speed of the ball by one. I will take it and drag and drop it right here. Let's start again. Speed of the ball is 0. Now its one. The score is 18, which is a bag. So I will stop it. And I would like to also have a score that is always 0 when we start the game. So go to the variables. Be careful we are in the bowl and I will set the score to 0. So I will start again. Score is 0, speed of the ball is one. Score is one. Now, speed of the ball is too. As you can see, it goes faster now. Okay? Now it's more difficult. And i1. So this was the game. Try to play your game. You can also do it more difficult by changing the speed of the ball by two. It's time. And this is really difficult right now. It's time you hit a break, the speed will change by two. Wow. It is very, very fast. Okay. So thank you very much. So I'm looking forward to seeing you in the next lesson. 18. Introducing Elsa and What We Will Create: Hey guys, welcome back. Now we're going to create a brand new game with Elsa. Elsa from Frozen. I'm a big fan of LSA. Actually. It is my favorite animated Disney movie. So we're going to create a game where LSA will ask the player of again some things and the player will try to answer these questions and we'll take points each time the player answers correct. So the question will be about frozen, about this movie. And we're going to add easy questions, but also very difficult questions for the big fans of Elsa and Anna from the frozen, that even, even Elson Tana can't answer. These frozen. Frozen is an animated Disney movie that was released about 67 years ago. It features two sisters and until Sir, who are very connected and children would spend each day together, most of weeds involved else's special ice power. But after a tragic accident, that could have done serious damage to honor, the king and queen decided it would be best for Elsa. Conceal her magic, show. She could learn to control it. Unfortunately, for LSA, as she grew older, she began to fear her magic, which only seemed to increase its power and danger. So from that moment, their lives tens forever. Olaf and Christoph ends when some other characters came into elses and Diana's life is a magnificent story. This will be a quiz about the movie Frozen one. You could of course, add your own questions and make your new version of this game. 19. Coding Elsa's Movements: So we're going to add some commands right now. Here we have LSA, the backdrop is white. Here is the sound of the frozen. So if you try to click the flag, that will listen the sound of Disney's Frozen. And if it's something that you don't like, you could take it off, stop it, and keep it right where we can add it later here. So let's go to Elsa and start creating our script where LSA will ask some things. First of all, let's see that LSA, she has many costumes. As you can see, there are many costumes where we will use them to give a natural sense of dialogue between LSA and the player. So first of all, I will add, go to the events and add when flag is clicked two sweets to cause him one. So we will go to Looks category suites, costume. Two, new picture right here. This is the first one. The first picture. Then we would like it's time c receives an event. For example, Elsa talk to repeat and go to the next costume. So we will add, we will add a new method right here when I receive new messages, messages, Elsa docs. So go to the control. Repeat. Here we have, let's see again how many costumes we have. 20 pictures show. I will repeat 19 times because this is the first picture and we have other 19 pictures. I would like to wait. Go to the Control and drag and drop weight about 0.1 seconds. And then go to the next costume, go to Looks category and find to this command next costume, right there. So double-click. And you will see that LSA is talking. This, it repeats next costume. So as you can see, it is very smooth. Very good. And now we have, as you can see here, there is the taskbar we asked her is a dot right here. So we will create an event when flag is clicked. It would like to go where it is right now. So go to Mohsen and go to, do not say that this value, x and y, x minus 40, Y's 38. It is okay. But we would like also to go to Looks category and show the dot. So the dot, dot, dot will be sown. Here it is. As you can see, here it is the dot. And the dot will be used to show that it will be where the bubble will start because LSA will move. But we would like to have a bubble right here with everything that it says. And we don't want this bubble tube. So we will go to the event and we want to wait for about 2.5th k and then broadcast the methods Elsa to talk we created here and methods I'll set talks. So go here, broadcast Elsa talks. And then LCG will say go to looks CE. And then two operators. Join, Hello. And here we want the username of the scratch environment. So here in the sensing, you will find that we have the username. So drag it and drop it right here, join Hello username. And be careful because I would like here to leave an empty space right here. So click to the flag to see what we have done until now. Hello, and here is my username. In Scratch environment, you will have your username right here. Then I would like to go again to the Looks category. Take say hello for two seconds. And I will change this to, I am Elsa. And I will ask, Do you like frozen? Then I would like to broadcast again LSAT talks. So I will go again to the event and broadcast. Elsa talks because at this point, LSA might stop doing this. I'll set OK. So stop moving. I would like to continue moving. So broadcast Elsa talks and then I would like to create again in dialogue. So go to Looks and say, so, do you want to play a game to see how much you like? Frozen? Very good. And I would like again to broadcast Elsa talks or go to the events broadcast. Elsa talk. 20. Coding Elsa's Questions: And now we will start creating some questions. I will keep it right here. This, you will see why I don't do this because we will create some questions for LSA and we will copy these questions so that we don't have to create all these blocks again. So we will create the first question right here. Broadcasts Elsa talks, and then I will go to the looks. And I will say, first question for two seconds, then I will broadcast again. So we'll do obligated broadcast Elsa talk. But this time I don't want to say something more. I would like to ask. So go to sensing and ask. And here we will start adding the questions. So the first question will be, what is the name of my kingdom? And wait. So then I would like to use an if statement, go to Control. And if else statement. The idea is, if the answer is correct, LCG will say, well done. If their answer is wrong, then LSA will answer wrong answer. So go to sensing and take the answer right here. Drag and drop it right here. If we carefully go to operators and take the equal sign and drag and drop the answer right here so that the right answer is R and L. But what I would like to do is give the option for the player to give about 23 or four answers. Because you might write R and L, which I would like to be able to correct or right are and so I would like also to take this. Correct. So I will give I will give him some options. So I will use this or statement. I will double gate this four times, and I will give him four right answers for options. And I will drag and drop this or statements. So be careful, I have this. I have three slots for the answer. I want a fourth one. And now I will drag and drop the, my answers here in this slot. So the first one is R and L. I will use R and L with capital letters and R And this run and also R and L. This one. So I will drag it and drop it. Of course, you can add even more, right answers as u is here, the third one, and I will go right there. You can click this button right here so that this is a little bit smaller. And I will add this one right here. And I would take all these blocks and arbiter right here. So if the answer is one of these, then I would like to say, well done. So I will broadcast again, go to the events broadcast Elsa docs and say, go to Looks, say, well, done. If the answer is wrong, then again go to the events broadcast. Elsa talks and go to Looks and say, wrong answer. But I would like more to do is actually to create a variable score. So let each time the player gives the correct answer then to take 1, so go to variables, make a variable, I will leave it to score. Okay? Here it is. My variable score is 0 right now. So I would like, of course, when the flag is clicked to set the score to 0, it's time that the flag is clicked, but it's time. The answer is correct. I would like to change score by one. If the answer is not correct, he will not take any point. So here it is, my first question. I will create more questions. So I will replicate this hall. As you can see, all these blocks. And I will add this one. Go right here. This is the second question. Shall we write Second question? I all right. Second question. I will just sent the question and the answers. All the other things will be exactly the same. My first question was about the Kingdom. The second question will be a little bit more tough. It is, who saves Ana from freezing inside the Kingdom? Who saves Ana from freezing inside the Kingdom? And the right answer is all of all of capitals. All of And what else? So if the answer is correct, T, We'll take one more point. I will duplicate again all these. Very good. And I will create a third question. I will take this block. I will go here, okay, now I have the first question and the second question. Let's create the third question. Third question. The third question is, what is the name of the song else's sings when she arrives at the North Mountain. What is the name of the song? Sings when see arrives at the North Mountain? And the right answer is, of course, let it let it go. I write it. Let it go. With not capital letters, with capital relish, and let it go. Very good. I will now create a fourth. The fourth question. You didn't take it, drag it and drop it right here. I duplicated the previous blocks. Fourth question. The fourth question will be a little bit more tough. Will be, how many brothers does Brin's hands have? Kalman brothers? Does principles have? Think about it. He has 12 brothers to L 1212. So this is the fourth question I will delegate to again, take the fourth quiz, dragged and dropped right here. I will add a fifth question. The fifth question will be even more tough. I will write here, who says, love IS putting someone else needs before yours? And the right answer is, Who says love is putting someone else's nice visual for yours? And the answer is, again, all laugh. Yeah. All offset this magnificent thing. Olaf. And Olaf. I will delegate again this blocks. I will take this fifth question bracket and drop it right here. Sixth question. Six question will be, who tells LSA that E1 is supposedly Gan, hotels else habit and I supposedly gun. And the right answer is think about it. Is Prince hands. So prints hands. Prince hands. And prints hands. This is the sixth question up. Okay, I will duplicate it again. So we will create about ten questions. So this is the sixth question. We will go to the seven question. Seven question will be, who says who says the only frozen heart around? Around here is yours? Who says the only frozen heart around here is yours? And the answer is that Ana says that the only frozen heart is yours. In case that the player forgot to add one en algo, also take this as correct. So if the player P, If the player rights are now with double l or if not capital letters or with capital letters, or even with one end, it will be correct. So I will duplicate it. I will duplicate also these blocks. I will take the seven questions. I will add it right here. Okay? Eight question. What tasty smell deed? The sisters bond over. What days is melted? The sisters want over? And the right answer is cheese. Cheese, it's chocolate. Chocolate, Exactly. Ciao, correlate. And jaw. Call late. Very good. Let's go to the ninth question. I will drag it and drop it right here. Ninth question. Ninth question will be a little bit easier. What is the name of Christopher render? And the right answer is, of course x1 when x1 van and I will take this one also as correct. Very good. And the last one, I will create, the last one. The tenth question. The last question will be, where deed Elsa create here iss kingdom? And of course the answer is the North Mountain. The North Mountain. The North Mountain. Here, you could add even more, right answers. North Mountain. Where good? Here we have the tenth question. And be careful that everything is ninth question. Next question. You can revise your questions. Seventh, sixth, fifth. Fourth. Third question. Second question. And First question. 21. Finalizing the Game and some Minor Improvements: Very, very good. So here we have ten questions and we can create a final if-else statement where we could say, if the player answers correct about seven questions, then well done. You are extremely good player. A message like this run. So I will go to the control and add an if statement right here. And I will use if, go to the operators greater than, greater than seven. If score is greater than seven, so take the variable score, go to variables score. Then say go-to looks. Looks. And I will take this and drag right here. Go to loops and say, wow, you are a great fun of frozen. I, you are extremely good. Congratulations. I will delegate this block. And I will say if score is greater than four, then C will say, you are good enough. But you can also see what's the movie. Again, to be a really great player. And finally, I will duplicate again. If score is greater, I'm sorry, be careful. The if statements should be for first if statement, the second statement, the statement, if score is greater than 0. So it means that it is less than seven, is less than four. So it is about 023. You are not fun of frozen or you didn't. What? The movie at all. Why? This is a great movie? Go now to watch it. Or you will be frozen. Of course you can add whatever else you want. So this is the game. Let's see the game right now. Let's see the game. Very good. I like it, I like it, I like it. I will click here full-screen control. And Start right now. Hello. No, no, no, no. I will go back four. And I will go here to the bars. I'm sorry, I will go here to the backdrops and I will add also the sound. I would like to have the sound right here. Go again fullscreen and start the game. Hello, hello, hello, IMLS or do you like frozen? So do you want to play a game to see? Yes, of course. You can add more questions for you want. What is the name of the kingdom? And the answer is R and L. Well-done. Score number 1. Second question. Who's saved Santa from freezing inside the Kingdom? I will say. I don't know the answer. Okay. Okay. Let's think about it. Is it prints hands now is it's when it is all. Very good. I think that is let it be frozen. Wrong answer. It was left to go forth. Question, How many brothers do does Brinch Hansen have 123 points? Well done. Fifth question. Let's go. Who says love is putting someone else needs before yours? I believe that it's Christoph. No rogue answer. It's all love. Six question. Hotel sells at a tunnel supposedly gun, it's prince. Hands. Well done. Seven question. Who says the only frozen heart around here is yours? I don't know who says. Okay, it's an of score five, golden eight question. What taste? It's melded. History, Ben, bond over its seas. Wrong answer again. Okay. Now I have question. What is the name of crystals render? Of course, it's when well done. And the final question, where the delta create share here, we need an R shell, I stink dm is the North Mountain. The score is seven, is not greater than seven. So the message is that an OK, here we have a back, let's go back. Let's go back, let's go back. Let's go right here. Here we have a serious bug. I will go right here to stop the music. Very good. I will go back to ask bar, and here is my bag. It is a big bag. Because if the score is eight, This means that it is greater than seven, it is greater than four and it is greater than 0. So what I should do is chains greater van, with less than. This is a big mistake. So I would like to take, if the score is less than seven, if the score is less than four. I need this to detect if the score is not greater than seven. So I go make a change right here. I will create drag-and-drop this if else statement. And I will say, if the score is greater than seven, then say, wow, else. I would like again the else if statements. So else, if the score is greater than four, then say you are good enough. And bracket and Robert Wright here. Finally, if the score is actually, I don't need this one because this means that it will be less than four. So be careful. Here we have an if statement and the if else statement. And inside the else statement here we have an other if else statement. So now it will check if the score is greater than seven. And for example, if we have score number eight, then only this command will be executed. If we have score number seven, this means that seven is not greater than 70 is equal with seven. So it will go to the else statement and it will check if the score is greater than four. Yes, it is. So only this command will be, will be executed. And finally, it will check the else statement. So this is our game. It is a complete game right now. You can create, of course, your own questions and create your own version of the game. So this was the frozen game. I really like this game and I'm looking forward to seeing you in the next lessons.