• Create Account

First Ever Game Created - Tetris

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

#1RockDoc  Members

110
Like
1Likes
Like

Posted 07 June 2012 - 11:44 AM

Hello GameDev community!

I took a programming class on Java a couple of semesters ago, and decided to expand my computer programming skills by learning to create games. I purchased Killer Game Programming in Java and created this tetris clone after reading the first few chapters. The reason I am posting this to the forum is to receive feedback on my implementation. The basic game loop is pretty much taken verbatim from the book.

The way I decided to implement this was to create a 2d screen array. Each entry in the array corresponds to a block on the screen (with 0 being white or empty). I then created a class for each individual piece. The pieces are represented by four coordinates, corresponding to the relative locations of the four boxes (for example a line piece was (-2,0) (-1,0) (0,0) (1,0) ) , and a coordinate that corresponds to the position of the (0,0) box in the array. The pieces are then drawn relative to this (0,0) position.

My goals for this game were to create the game without looking at specific online tetris tutorials (to force myself to learn to think like a game programmer) and use good object oriented as well as game programming style.

My biggest annoyance with the way I implemented the game were that I couldn't figure out a clever transformation on the pieces to rotate them, I instead ended up hard coding all the different rotation states.

I was hoping that some of you with game development experience could comment on whether the way I implemented this game is a logical way to do it (it works, but for all I know there could be a way simpler way to do this) and to take a brief look at my code and suggest ways I could have better used object oriented style and game programming techniques.

Thanks for reading and I appreciate any feedback that is offered!
-RockDoc

#2szecs  Members

2818
Like
0Likes
Like

Posted 07 June 2012 - 02:02 PM

I haven't looked at it yet, but up front, the only thing matters is that you made that game. And you made it on your own. You are already ahead of the most newbies, because that's the way to learn problem solving.

Your next game will be much better coded.

Congratulations, programmer!

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.