Tetris is a classic puzzle game in which players manipulate falling tetrominoes to fit them into a grid. The goal is to create complete rows, which will then disappear and award points to the player. The game ends when the tetrominoes reach the top of the grid.
In this project, I will be creating a Tetris game in Scratch, a popular programming language and online community for creating interactive stories, games, and animations.
To create this Tetris game, I will be using Scratch's blocks and scripts to create sprite objects and control their movement and behavior. I will also be consulting online resources and tutorials to help me understand how to use Scratch effectively for this project.
Driving Question
How can I use Scratch to create a functional, enjoyable version of Tetris?
Procedures:
Set up the stage
Design the tetrominoes
Make the tetrominoes fall
Allow the player to rotate and move the tetrominoes
Check for completed rows
Keep track of the player's score.
End the game when the tetrominoes reach the top.
Purpose : In my PBL project, I will look to create a game like Tetris using Scratch. The purpose of this project is to use and learn how to code a game. Although it isn't any programming language, it can help train my brain to think logically for the computer. The project will help me attack the problem little by little. I will figure out how to get points, change the piece, and clear the lines.
Materials: For this project I will be using Scratch, so the only think needed is a computer with a Wi-Fi connection.
What I will do : The procedure is to learn and research how Tetris was made. We would have to logically start to code the first background , then the pieces, then the line clear and score. We would have to make a grid for the background, so we would be able to calculate if they completed a line by filling in the grid in a horizontal line. After that we code the pieces to randomly choose a piece after dropping one and code controls for moving the piece. After all that we would look to create a score system with more line clears to add points to your score. Lastly, we would have to make the game end if the building reaches the maximum height.
Safety: Since we are using a website there are no immediate safety concerns of chemicals or machinery. Possible risks are downloading things that you believe will help with the project. Since there are no official codes for Tetris you might find yourself looking deep on the web at unsafe downloads to find possible codes.
Pictures and/or Action Video
Investigation Questions
How can the movement and rotation of the Tetris pieces be programmed in Scratch?
The movement and rotation of the Tetris pieces can be programmed in Scratch using a combination of sprites, variables, and control blocks. The sprite representing the Tetris piece can be moved horizontally using the "move" block, and rotated using the "point in direction" and "direction" blocks.
What is the best method for detecting and handling line clears in the Scratch Tetris game?
The best method for detecting and handling line clears in a Scratch Tetris game would be to use variables and control blocks to keep track of the position of each block in the grid, and then use conditional statements to check for complete lines. When a complete line is detected, the blocks above it can be moved down using the "move" block, and the line can be cleared by resetting the variables associated with it.
How can user input for controlling the Tetris pieces be implemented in Scratch?
User input for controlling the Tetris pieces in Scratch can be implemented using the "when key pressed" block, which can be used to move or rotate the piece in response to key presses.
How can Scratch be used to get into other programming languages?
Scratch can be used as a stepping stone to other programming languages by teaching basic programming concepts such as variables, control flow, and event-driven programming. Scratch's drag-and-drop interface makes it easy to learn these concepts without getting bogged down in syntax, which can make it easier to transition to text-based languages like Python or JavaScript.
"Scientific Principle" or "Essential Understanding":
All the building blocks on Scratch represent real programming codes. For example, the "repeat" blocks in Scratch are the same as for loops in programming. Scratch is an easier way of programming with familiar words instead of code syntax. An "essential understanding" for the Tetris project could be understanding the concept of game mechanics and how they are implemented in code. This includes understanding how to move and rotate game objects, detecting and handling player input, and implementing game logic such as scoring.
Real Life Connection :