Skip to main content

Posts

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

Blinking Multiple Leds (Black Lightning) - With Mblock

 Before this application, we had blinked a single led. In this application, together with the Mblock program, we will make more than one led blinking, in other words, black lightning. The list of materials that our program will need in our led circuit before proceeding to the codes: 1-Arduino Uno 2-BreadBoard 3-7 LEDs 4- 7 pieces of 220Ω Resistor 5-Jumper Cables We need supplies. We add a 220 ohm resistor to the long leg of the LEDs we add to our breadboard. We connect one leg of the resistor with a jumper cable, starting from the digital pin 2 of our ardunio uno material, to the 8th pin. We connect the short leg of the LED to the GND (negative) terminal of the Ardunio Uno with a jumper cable. However, since there are 3 GND terminals on our arduino uno board, we connect the jumper cables that we connect to the short leg of the leds to the + or - terminals at the bottom of our breadboard. The cables must be aligned, we can connect the cables horizontally in the + or - ...

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

Converting Length to Meters and Centimeters With Scratch Program

 We will make an example of Converting the Entered Length Measure to Meters and Centimeters with Scratch. For this sample application we made with the Scratch program, first of all, we create data from the variables menu to hold the data in meters and centimeters that will be created as a result of the process. Since I will create speech sprite in the program, I am adding a sprite. Code part: When the green flag is clicked, I first set 0 to the meter, centimeter and given length measurement. If we do not set 0, if the program has been used before, the numbers of the old data will appear in the first run. After writing the code that makes the data 0, we add the speech sprite that appear in the sprite from the looks menu. And we use the ask and wait command from the sensing menu to get the user's length measurement. After taking the length measurement in centimeters from the user, he came to convert it to meters and centimeters with mathematical operations and commands. The length un...

Soccer Game on Scratch Program

 We're going to make an example of making a Soccer game with Scratch. We add 1 ball, 2 paddle lines (to meet the ball), 2 thin paddle lines (they will act as a goal) from the scratch library in order to make a mutual soccer game in Scratch. You can also add any decor you want to the backdrops. To keep the score, we create 2 data named player-1 and player-2. First of all, we will move the green paddles lines that will act as a castle. These lines will only move up and down. In order for these lines to move when the green flag is clicked, we first add the "Forever" code under the Control codes. If we do not add this, how many steps will move when we press the button we will move will remain there. In order to avoid this situation, we must add a forever movement code. After adding the forever code, we check with the "If" code whether the key to be moved is pressed or not. If the W key is pressed, move the green bar. While moving up and down, the movement will take ...