Skip to main content

Posts

Showing posts with the label Scratch

Keeping Number of Vehicles Passing a Red Light with Scratch

 In this application, we will do an activity to keep the number of vehicles passing the red light at the scratch. First of all, we find a traffic light on the internet. At first, all the lamps are dark, by painting the red light, by painting the red and yellow light, by painting the yellow and green light, and finally, by painting only the green light, the sprite has 5 costumes in total. After adding our traffic light, we add a road image to the backdrops decor. In addition, we find a car picture on the Internet for the car that will pass on the road and add it. I drew a line on the road and painted it red in order to detect the people passing through the red light.   Now it's time to move the car. Below are the codes that we will write inside the car sprite. Clicking the Green Flag hides the car, and we create a variable from the Variables menu to keep cars running through the red light. Initially let this variable be zero. Because if the game has been played and closed b...

A Digital Footprint Test with Scratch

       In the lesson, we will do the digital footprint test of our students with scratch. For this, we add a sprite to our screen that will give instructions to the test, and 2 buttons for yes and no answers. Since the answers to the questions we ask will be yes and no, we create variables that will keep the number of yes and no. At the end of the test, we multiply the sum of the yes numbers by 2 and the sum of the no numbers by 1. We assign the result to the yes score and no score variable. We add the values ​​in these variables and assign them to the total score variable. The numerical values ​​of the result have a corresponding value. I will give them at the end of the article. Let's move on to the coding part;        We write the following codes inside our human sprite.           When the green flag is clicked, we set the variables that hold the total result to 0. The purpose of zero is that when we restart the test,...

Computer Input and Output Hardware Units Game Making with Scratch

 In this application, we will make a game of computer input and output hardware units with the scratch program. The game will be as follows; The user will be prompted to drag and drop pieces of hardware into the input and output device areas. If the user places the piece of equipment in the correct area, he will receive 5 points, if he places it in the wrong area, he will lose -5 points. Now it's time to code our game in the scratch program. First of all, we draw the sprites on which we will place the input and output hardware units from the costumes menu. After that, we add the hardware units that we downloaded to our computer before and the emoji expressions and the sound of applause when it is right or wrong. Let's come to the code part;   If the person playing the application places the equipment in the correct area, he will gain 5 points, if he places it in the wrong place, he will lose -5 points. For this we need a variable to hold the score. We create a variable calle...

2 Level Game Making With Scratch

 We will make an example of a game with 2 levels with Scratch. In the first level of our game of matching the color-changing ball and the rectangle, which we will do with the Scratch program, there will be a rectangle that we can move left and right with the arrow keys. The color name will be written inside the rectangle. Colorful balls will come from the upper part of the stage. If the color name in the rectangle and the colored ball are the same, hit the ball and your number of Greetings will increase by one. If not, your remaining health will decrease by one. When your greeting number is 5, you will pass to level 2. In order to make the game a little more difficult at level 2, the color name in the rectangle and the color of the rectangle will be different. But the user will decide whether or not to touch the ball based on the color name. The rectangle color here is made so to force the user. Let's come to the code descriptions of the game; By adding a new sprite, we are adding ...

Making Mole Hunting Game with Scratch

 We will make an example of a mole hunting game with the Scratch program. The rules of the Mole Hunting Game Example that we will do with the Scratch program; There are 7 moles in 20 seconds. These moles come out of their nests and you have to hit them with a hammer. Each mole has 3 lives. If you hit a mole with a hammer 3 times, you will hunt it. You need to hunt 7 moles for 20 seconds to win the game. You gain 1 point for each hit. First of all, we draw and prepare our scene for the mole hunting game. We draw 2 different rectangles using the rectangle tool with yellow and green colors. Then we draw the molehills using the ellipse tool with turquoise color.   Let's come to the drawing of the hammer that we will use in the game, you can find it ready on the internet and use it, or you can draw it yourself like me. We use the rectangle tool when drawing the hammer. Its center point should be as in the image below. Then we right-click on our tow's disguise and say "copy a co...

Line Following Car With Scratch Program

 We will make the example of a line following  car with the Scratch program. For the line following car sample application that we will do with the Scratch program, we will first make a car track. For this, the scene in the lower left is selected. Then, we click on the backdrop in the middle of the Code and Sounds tab, which is in the middle of the screen. Here we select the circle icon, specify the color of the track, and then draw a circle, outlined circle. Let's draw the edge of the circle in bold. Then we click on the pencil icon in the sprite part (Draw a paint). Here we draw a rectangular car. We draw two small squares. These will be the wheels of the car. We draw two much smaller rectangles. We do two of these with different colors. Because, so that we can control more easily whether it is out of line or not. We put the car on the black line of the track. The most important point here is that we are making the car smaller. Two colored headlights on the front of the car ...

Body mass index calculation on Scratch Program

 We will make an example of the Body Mass Index Calculator program together with the scratch program. The Body Mass Index Calculation formula that we will do with the Scratch program: Bmi = Weight (kg) / Height (meter) * Height (meter) The codes are as follows; First of all, we add someone as a sprite and the text that writes the body mass index calculation. Codes inside the sprite that writes body mass index calculation: To make the text larger and smaller (Zoom effect), we enlarge the text by 10 size, wait for 1 second, and enlarge it by -10 size (ie reduction operation). You can enlarge or reduce the text as much as you want. Up to you. After hiding the text with the hide command, we release a message for our other sprite to appear on the screen. When Start Programme command comes, our other sprite comes into play and appears. After it appears, the User is prompted to enter his height in centimeters. We do this with the ask and wait command from the sensing menu. The value ent...

Bricks Breaking Game on Scratch Program

 We will make a brick breaking game example with the Scratch Program. Brick Breaking I added 1 ball from the Scratch library, 1 Green Line (to meet the ball), 1 Red line (to reduce health when the ball hits here), 7 buttons from the Scratch library for game making (I added a button because there is no tile in the library).   Below are the codes to be written inside the ball.                              First of all, we create a variable from the Remaining Life Data section. We make the remaining health variable get 5 when the green flag is clicked. If there is a possibility that it is a previously played or unfinished game, we make the remaining life 5 when each game starts. We start the ball at the coordinate 0,0 so that the ball starts from a point. We make each step of the ball 5 steps. We include it in the command to constantly repeat the step it will take so that it is constantly in motion. We con...