Advertisement

Tetris Clone

Started by February 28, 2003 10:24 AM
2 comments, last by Caol 21 years, 8 months ago
I want to create a Tetris Clone using C++. How do I go about this? Where do I begin? What do I need to know. I do not have very much experience at all in C++ (see my post on Borland c++4.5).
First of all, you should gain experience in c++.. write lots of little programs that do stuff like calculator functions or problem solvers.. simple stuff.. you may hate it but it''s required...... then get a good game programming book (for whatever api or whatever you plan on using)... from there start with small games (maybe an animated tic tac toe game?)... work your way up.. don''t jump right into a project like that..
Disclaimer: "I am in no way qualified to present advice on any topic concerning anything and can not be held responsible for any damages that my advice may incurr (due to neither my negligence nor yours)"
Advertisement
And you shouldn''t be thinking about graphics & sounds too much. Since you''re new to C++, first thing to learn is the language itself, the way Caol just mentioned. After that, you can look at the fundamental things you need to know when creating a game-engine (there''s tons of information on the net). When you get the basic idea ie.
while(alive == TRUE)
{
gameLogic();
input();
graphics();
}

You can easily write a game like Tetris pretty much on your own. If you need help in every part, then you aren''t ready to start with a game, it''d just go something like: "How do I do this then?", get an answer, and go "huh? oh well, okay, gotcha". And then you''re forced to asked how to do the next step, if you don''t have full understanding over what you are doing.

I just wrote my first -real- game, strictly in C (started with C++ now), the game being Tetris ofcourse
I''ve been programming in C for a year or two, so the language itself doesn''t cause me any problems. So I started reading about how games are constructed, and when I understood most of it, I just started with simple projects like:
"How do I make an ascii-character move up/down/left/right" when I press certain keys?"

then "how do I check for walls" and "how do I make the ascii character grow a tail when I ''eat'' something (placing the character ontop of something else)" And boom, you almost have game "Snake" ready.

After that, I started on my Tetris-game, drove a couple of pics and wrote a few things down on how to rotate the pieces and how to do collision detection. After 2 days I had ASCII-tetris ready, without points or levels or cool graphics, it still was a tetris game.
I could simply add points and things like that to it, but it felt quite useless when it was all in ASCII and not that fun to play. Then I asked people about the whole graphics part, and came into the conclusion that Allegro was the best choice for me, as I wanted to write the whole game in C, and not have to worry about odd Win32 API calls and handles and all those confusing things (Allegro is portable). And I found it surprisingly easy to add graphics, and with graphics you want points, and with points you want levels, and with levels you want highscores..

That''s how -I- started, anyways
And then there''s this: http://gamedev.net/community/forums/forum.asp?forum_id=33

Which is an entire forum on this website dedicated to a tutorial on C++, designed games using C++, and building a tetris clone entirely from scratch.

This topic is closed to new replies.

Advertisement