You are browsing as a guest. Sign up (or log in) to start making projects!

1h 51m 24s logged

DEVLOG 2

Ok it’s been a couple days but I’ve added key presses where:

-Left Arrow = Piece moves to the left
-Right Arrow = Piece moves to the right
-Down Arrow = Piece soft drops.
-Space Bar = Piece hard drops.

Overall it wasn’t that hard to implement but I had this bug where after soft dropping it saves that position to the locked pieces array. Which in return kind of broke the whole game. Here is the broken code block:

if event.type == pygame.KEYDOWN:
    if event.key == pygame.K_LEFT:
        self.currentPiece.x -= 1
        if not validSpace(self.currentPiece, self.grid):
            self.currentPiece.x += 1

            lockPiece(self.currentPiece, self.locked_pos)

The problem was the last line where it says

lockPiece(self.currentPiece, self.locked_pos)

So all I had to do was remove that and it works perfectly. Now I need to make the game rules where if you finish a row it deletes it and then the hardest part… ROTATION.

0
85

Comments 0

No comments yet. Be the first!