Blind Blocks (a.k.a. Tetris After Dark): sitting at 21 hours of development.

Andrei Marks · September 12, 2011

The game looks a lot better than it did at the end of each of the past two days. I’ve gotten a lot of the under the hood stuff down, so now I just need to work on some design elements, features, scoring, loss conditions, etc.

Unfortunately…I’m at that point in the game where it’s playable enough that I keep getting distracted from development by “game testing.”

Tetromino Rotations

I plotted out all the tetrominos and  finished all of their rotations. I just did it the brute force way, plotting all the coordinates for relative translation by hand (see the bottom of the post). After I’ve learned some more programming techniques I’ll probably come back and condense the code. Anyway, that was kind of time consuming.

Tetromino Data Structures

I’ve definitely gotten a little more proficient with python’s sequence data types (e.g. lists, dictionaries, and sets), but there are still a bunch of shortcuts I’ve seen in my wanderings around the web that I have yet to understand and implement.

It was a pretty interesting mental exercise figuring out how to cause the rows above deleted rows to drop down, and ultimately I decided to have the program check all the rows above a cleared row for blocks, and move them down a space, and repeat that if there are lower rows that were also cleared at once.

Also, I’m getting better with managing data types.

Remaining Collision and Movement Problems

I need to work on wall kicks and rotation into surrounding blocks. I don’t think resolving those issues will be terribly difficult, I’ve just been putting it off to focus on more of the eye-candy stuff.

Also, I’ve been managing block descent through pixel-based movement. And the faster the game gets the more likely it is that a player pressing down will cause a descending block to jump “through” the uppermost block and disappear into the mass of blocks, I need to fix that even though it’s not so much of a problem now.

Less of a pressing issue is that I think the player’s left-right motion isn’t “sticky” enough, I might lower the sensitivity.

Graphics

I decided to take the sonar idea in a more practical direction. Initially, I’d thought I would have the sonar waves trace an outline of the blocks it touched. I’m not sure how to do that yet, but I found a stand-in animation that I like better, which is simply the sonar waves flooding the background, leaving a silhouette of blocks, and the blocks “responding,” as if they were actually pinging back.

One issue I have to tweak is the darkness of blocks. It can be a little difficult to see, but I kind of like it that way. I think that by giving the player’s more pings (I’m thinking three per block, a number that gets reduced over the course of the game).

I’ve also decided to add additional “tools” to the players tool box. Aside from sonar pings, I’m also going to throw in infrared and a flare. The infrared will have a meter that depletes so long as it’s on, and you get refills as you clear blocks. The flare might be a three-time use thing, and it will illuminate the screen entirely for a 10 second window or something.

Also, I need to work on the interface, because at the moment it is just the playing field.

blockies = {'oBlock':[[(0,4,0), (1,5,0), (2,4,1), (3,5,1)],
            [[(0,1,0), (1,0,1), (2,0,-1), (3,-1,0)],    # Translation coordinates for rotation 1.
            [(0,0,1),(1,-1,0),(2,1,0),(3,0,-1)],        # ...for rotation 2.
            [(0,-1,0),(1,0,-1),(2,0,1),(3,1,0)],        # ...for rotation 3.
            [(0,0,-1),(1,1,0),(2,-1,0),(3,0,1)]]],      # ... for rotation 4.
            'iBlock':[[(0,3,0), (1,4,0), (2,5,0), (3,6,0)],#    etc.
            [[(0,2,-1), (1,1,0), (2,0,1), (3,-1,2)],
            [(0,1,2),(1,0,1),(2,-1,0),(3,-2,-1)],
            [(0,-2,1),(1,-1,0),(2,0,-1),(3,1,-2)],
            [(0,-1,-2),(1,0,-1),(2,1,0),(3,2,1)]]],
            'tBlock':[[(0,4,0), (1,3,1), (2,4,1), (3,5,1)],
            [[(0,1,1), (1,1,-1), (2,0,0), (3,-1,1)],
            [(0,-1,1),(1,1,1),(2,0,0),(3,-1,-1)],
            [(0,-1,-1),(1,-1,1),(2,0,0),(3,1,-1)],
            [(0,1,-1),(1,-1,-1),(2,0,0),(3,1,1)]]],
            'sBlock':[[(0,4,0), (1,5,0), (2,3,1), (3,4,1)],
            [[(0,1,1), (1,0,2), (2,1,-1), (3,0,0)],
            [(0,-1,1),(1,-2,0),(2,1,1),(3,0,0)],
            [(0,-1,-1),(1,0,-2),(2,-1,1),(3,0,0)],
            [(0,1,-1),(1,2,0),(2,-1,-1),(3,0,0)]]],
            'zBlock':[[(0,3,0), (1,4,0), (2,4,1), (3,5,1)],
            [[(0,2,0), (1,1,1), (2,0,0), (3,-1,1)],
            [(0,0,2),(1,-1,1),(2,0,0),(3,-1,-1)],
            [(0,-2,0),(1,-1,-1),(2,0,0),(3,1,-1)],
            [(0,0,-2),(1,1,-1),(2,0,0),(3,1,1)]]],
            'jBlock':[[(0,3,0), (1,3,1), (2,4,1), (3,5,1)],
            [[(0,2,0), (1,1,-1), (2,0,0), (3,-1,1)],
            [(0,0,2),(1,1,1),(2,0,0),(3,-1,-1)],
            [(0,-2,0),(1,-1,1),(2,0,0),(3,1,-1)],
            [(0,0,-2),(1,-1,-1),(2,0,0),(3,1,1)]]],
            'lBlock':[[(0,5,0), (1,3,1), (2,4,1), (3,5,1)],
            [[(0,0,2), (1,1,-1), (2,0,0), (3,-1,1)],
            [(0,-2,0),(1,1,1),(2,0,0),(3,-1,-1)],
            [(0,0,-2),(1,-1,1),(2,0,0),(3,1,-1)],
            [(0,2,0),(1,-1,-1),(2,0,0),(3,1,1)]]]}

Twitter, Facebook