Skip to main content

Posts

Showing posts from December, 2021

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

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 shoul

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 entered