How much do I need to cover or think about before coding Tetris mechanics

Started by
3 comments, last by Nicholas Kong 10 years, 8 months ago

So I have been doing a 2 hour thought process before coding any features of Tetris.

I am trying to cover anything that can potentially go wrong before I code it up. That way I don't wind up shooting myself in the foot or with long development time.

Things I thought about:

1) row test optimization

2) moving the tiles of the pieces using arrow keys

3) shifting control to a new piece once the previous piece is locked in place

4) generating a random piece from a list

5) know which row to eliminate from the board

6) making sure tile that is part of the piece is in the same orientation even when a row has been cleared.

This personal game project is much bigger than my simple arcade shooter and Pong game. My previous project never followed a thought process of 2 hours. It was more about adding a feature and making sure it works before moving on to a new feature.

How much do I need to cover before coding Tetris mechanics? How do I know I did leave anything out?

Or should I just implement the features I have right now and go from there?

I need suggestions on this coding practice.

Advertisement

I recommend just going with what you have now, and then working it out as you go. This I recommend because it appears you already have planned out things you need. If you hadn't, I would do some planning first, but you already have. Just to get you started, most Tetris games use some sort of arrays to control the game board, which would also make things easier as far as collision checking and row removal.



Forget 1) until you have a working game. Write the simplest, most readable code you can that gives you correct results. There's no actual need to optimize anything in a Tetris clone. If you were working on a larger and more resource-hungry game, you should still use profiling to find and verify actual bottlenecks before rushing to optimize something.

I recommend just going with what you have now, and then working it out as you go. This I recommend because it appears you already have planned out things you need. If you hadn't, I would do some planning first, but you already have. Just to get you started, most Tetris games use some sort of arrays to control the game board, which would also make things easier as far as collision checking and row removal.

Okay I will go with that approach. Thanks for the heads-up!

Forget 1) until you have a working game. Write the simplest, most readable code you can that gives you correct results. There's no actual need to optimize anything in a Tetris clone. If you were working on a larger and more resource-hungry game, you should still use profiling to find and verify actual bottlenecks before rushing to optimize something.

Good idea. I will focus on readablity of code and getting these features up and running. Thanks!

This topic is closed to new replies.

Advertisement