Sign in to follow this  
Nicholas Kong

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

Recommended Posts

Nicholas Kong    1535

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.

Edited by warnexus

Share this post


Link to post
Share on other sites
kburkhart84    3182

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Nicholas Kong    1535

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!

Share this post


Link to post
Share on other sites
Nicholas Kong    1535

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!

Edited by warnexus

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this