Tetris Remake

The Task

For school, we got assigned a task to remake the game “TETRIS“. We had two weeks to make this remake. It took me one day, of course, I rather not be cocky about it. But I think it is an accomplishment that I am very proud of. So will tell you how is did this in one day.

Rules

We go some assets to start with, a tile sprite and 3 scripts (Logicmanger, Visualmanager, ILogicManager). The rules were very simple.

  1. We can’t add a public function to the Logicmanager.
  2. we can’t change stuff from the interface.
  3. the Logicmanager can’t communicate with other scripts.

So yeah it was pretty obvious. that Logicmanager had to be the brains. And that it already contained all the values that we need for the VisualManager. So yeah I got started and began being able to draw the Tiles. Because I felt like that would be easier to debug.

I started to make the VisualManager. and made all the drawing methods. “DrawFixedPieces, DrawActivePiece, DrawGhostPiece”. And also added some methods to convert the piece to make it easier to read.

First things first I created a method that would spawn pieces in the game in the LogicManager. And with that I added a method that simulate the piece for it to fall down. At this point I was very happy with my progress because, all this progress was within 1.5 hours and I made all this.

Apperently my teacher said that Collision was the hardest to do. And he wasn’t wrong about it. But just not to me, I complety planned out how I had to do create Collision in this game. Because there we just 2 types of Collisions that could happen in the game 1. Map Collision 2. Block Collision. So I made 2 methods to detect these Collisions. With some overloads for future use.

I made it clear that Collsion wasn’t hard for me. But there was something else that was hard for me. But the Scoring part of tetris was for me. Because after you gained points. You had to make all the rows drop down if they can. And I tried to make it very preforment. Even when it wasn’t nessacry so it took me a while to correctly let the rows fall. But after a while it worked. just needed to find the way to make it.