Members - Reputation: 107
Posted 24 May 2012 - 06:28 PM
Moderators - Reputation: 14830
Posted 24 May 2012 - 10:38 PM
You'll use XNA to display stuff, so naturally you'll need an understanding of math through algebra for a 2D game. You'll need to learn about textures and surfaces and displaying text, and so on.
The game itself can be played as a simple text-based set of boxes or as a set of pretty graphical boxes. Either way, the core game is identical. Personally I'd recommend you start with a plain text version just so you can focus on making the game instead of making an animation system. You'll need some understanding of arrays, but the game is simple enough that you don't need more complex math to implement it. You just need to test if you can move the shape to the next coordinate, and if so, do it.
Next you'll probably want to make it graphical. Moving a well-written game core over to a graphical system is very straightforward; instead of drawing text you draw images. Of course, if you didn't go the route of writing a text-based set of boxes first then you are likely to confuse the two, ending up with trying to move a hybrid collection of graphical objects inside a logical space. Don't do that unless you feel like not completing your project in a timely manner.
You'll want menus to display your game options, your game credits where you can state how awesome you are, high score screens, etc. That means either hard coding the menus or writing a more complex system that enumerates the available menu choices and sends the commands off to the controlling system; it is more work but more versatile. Since your goal is writing a quick-and-dirty game, I suggest hard coded menus for now.
You don't want the scores to vanish when the game is started over, so you'll need to learn enough about serialization to save and load the scores and other info. Fortunately C# makes this very easy. You may also want to save and load a game in progress, again C# makes this very easy.
You may be interested in the TDD Tetris example at https://github.com/orfjackal/tdd-tetris-tutorial. It is in Java, but they walk you through the first half of writing a Tetris style game that is fully self-testing. They start off with a text-based board, work their way up through text-based pieces, then provide a simple set of directions to go through the rest of the game. Once you have that working in C# it would be pretty easy to add an XNA front end to it.
Senior Staff - Reputation: 13979
Posted 25 May 2012 - 06:03 AM
What an excellent resource, thanks for sharing that link!
You may be interested in the TDD Tetris example at https://github.com/orfjackal/tdd-tetris-tutorial. It is in Java, but they walk you through the first half of writing a Tetris style game that is fully self-testing.
- Jason Astle-Adams.
Moderators - Reputation: 14830
Posted 25 May 2012 - 09:18 PM
There isn't really much to collision detection. You check each of the four tiles to see if there is a blank space in that direction. Four tests along the lines of if(occupied(x,y)) and you're done.
Thanks Frob, do you have advice on the collision detection system, and on the shape transformation system?
Rotation is similarly not very difficult, especially if you follow the step-by-step tutorial I linked to above.