19 Replies - 933 Views - Last Post: 03 December 2011 - 05:12 PM
#1
What are some fundamentals that go into making a Tetris game?
Posted 29 November 2011 - 08:19 PM
I was just wondering what aspects of C++ and SDL I need to know before/while I make a Tetris remake. Just to clarify, I mean like arrays, pointers etc... I have been using C++ for the past week or so and I am finding the concepts quite easy to grasp as I have used Visual Basic for 2 years prior so I don't think this is a 'bad' project for me to tackle first.
Thanks, Jakeks97
Replies To: What are some fundamentals that go into making a Tetris game?
#2
Re: What are some fundamentals that go into making a Tetris game?
Posted 29 November 2011 - 08:48 PM
Hope this helps
#3
Re: What are some fundamentals that go into making a Tetris game?
Posted 30 November 2011 - 10:42 AM
#4
Re: What are some fundamentals that go into making a Tetris game?
Posted 30 November 2011 - 12:03 PM
Also with any game, it is important to understand what goes into a game loop.
Game Loop Example:
bool quit = false;
Initialize();
LoadAssets();
while(!quit)
{
HandleInput();
Update();
Draw();
}
Also in a game loop, there needs to be some way to control how many times update and draw are called per second. In other words controlling the frame rate.
This post has been edited by Fib: 30 November 2011 - 12:05 PM
#5
Re: What are some fundamentals that go into making a Tetris game?
Posted 01 December 2011 - 05:04 AM
#6
Re: What are some fundamentals that go into making a Tetris game?
Posted 01 December 2011 - 03:17 PM
#7
Re: What are some fundamentals that go into making a Tetris game?
Posted 02 December 2011 - 12:54 AM
jakeks97, on 01 December 2011 - 05:04 AM, said:
Because I decided that i need to get better at C++ before attempting Tetris. Also API is for down the line... What books would you recommend?
Thanks
#8
Re: What are some fundamentals that go into making a Tetris game?
Posted 02 December 2011 - 07:33 AM
1. You won't learn as much C++ as a book dedicated to the language, which makes it bad.
2. They can only give you a very, very narrow perspective in programming games. Quite pointless.
Learn C and C++ to a very competent level first, then look into game programming.
#9
Re: What are some fundamentals that go into making a Tetris game?
Posted 03 December 2011 - 04:38 AM
ButchDean, on 02 December 2011 - 07:33 AM, said:
1. You won't learn as much C++ as a book dedicated to the language, which makes it bad.
2. They can only give you a very, very narrow perspective in programming games. Quite pointless.
Learn C and C++ to a very competent level first, then look into game programming.
I took your advice and have bought Thinking in C++: Introduction to Standard C++, Volume One (2nd Edition) (Vol 1)and The C++ Programming Language Special Edition.
Thanks for all of your advice.
#10
Re: What are some fundamentals that go into making a Tetris game?
Posted 03 December 2011 - 05:14 AM
jakeks97, on 03 December 2011 - 04:38 AM, said:
ButchDean, on 02 December 2011 - 07:33 AM, said:
1. You won't learn as much C++ as a book dedicated to the language, which makes it bad.
2. They can only give you a very, very narrow perspective in programming games. Quite pointless.
Learn C and C++ to a very competent level first, then look into game programming.
I took your advice and have bought Thinking in C++: Introduction to Standard C++, Volume One (2nd Edition) (Vol 1)and The C++ Programming Language Special Edition.
Thanks for all of your advice.
I also forgot to mention C++ Primer Plus.
#11
Re: What are some fundamentals that go into making a Tetris game?
Posted 03 December 2011 - 07:30 AM
Go to a bookstore and browse the C++ books. Buy one that you feel is a comfortable read.
One book that I will certainly recommend is 'The C Programming Language' by Kernighan and Richie. Trust me, this book is gold.
#12
Re: What are some fundamentals that go into making a Tetris game?
Posted 03 December 2011 - 12:41 PM
ButchDean, on 03 December 2011 - 07:30 AM, said:
Go to a bookstore and browse the C++ books. Buy one that you feel is a comfortable read.
One book that I will certainly recommend is 'The C Programming Language' by Kernighan and Richie. Trust me, this book is gold.
And horribly improper for a beginning C++ programmer. Its time to start treating C++ like the separate language it is. Recommending K&R C to a C++ programmer is like recommending a Porsche owner buy the Volkswagen user manual
Its a good book, remarkably concise and I highly recommend it; to C programmers.
As it sounds like you have enough books for now, you don't really need more recommendations, but C++ without Fear is a good book for beginners and Effective C++ is a must read, eventually.
#13
Re: What are some fundamentals that go into making a Tetris game?
Posted 03 December 2011 - 12:50 PM
Serapth, on 03 December 2011 - 07:41 PM, said:
Actually, no. You are wrong. You should be aware that in programming games, you actually use both C and C++ - generally the closer you get to the hardware, the more C is used over C++. Secondly, Software Development Kits (SDKs) written to be used with the C and C++ languages are actually written in C (possibly with some C++) in their own implementation(s) for the reasons given just now.
Serapth, on 03 December 2011 - 07:41 PM, said:
Correction, this is an outstanding book! If you can't see its worth then I have nothing to add.
Serapth, on 03 December 2011 - 07:41 PM, said:
Those are good book in your opinion. I would suggest that the OP goes to a book store with the list that we have suggested, and pick out two at the most after having thumbed through them. Getting books with duplicate information is a waste of time and money.
This post has been edited by ButchDean: 03 December 2011 - 12:51 PM
#14
Re: What are some fundamentals that go into making a Tetris game?
Posted 03 December 2011 - 02:31 PM
ButchDean, on 03 December 2011 - 12:50 PM, said:
I strongly disagree, on this, you are the one that is wrong. Recommending a C book to a new C++ developer is simply wrong, period. Of course there are aspects of C++ that are going to benefit from knowledge of C, as the language started as a superset ( I say started, as both languages have diverged greatly since 1983 and this is no longer factually true ). What language SDKs are written in has very little to do with what a new programmer needs to know, and the aspects of C++ that are still C will be covered in most modern C++ books. Suggesting a book like K&R C to a new C++ developer will lead them down the wrong path from day one. To this day you already see C++ programmers mixing new/malloc, streams/printf and various other constructs that do not mix. They are different programming langauges and should be treated as such. I am not saying there isn't value in picking up C at some point in time, but to suggest it when just starting out and learning, you are just muddying already murky waters and making it more difficult for the student.
Quote
Seriously, you are going to argue over the amount of superlatives I used? I acknowledge K&R C as a good ( fine outstanding ) book, but that doesn't change the fact it is a poor recommendation for someone just setting out to learn C++.
Quote
Well of course book recommendations are a matter of opinion, I hardly think when describing books you recommendations you need to preface with "In my opinion" as... well that is exactly what a recommendation is. That said, Effective C++ is pretty much universally praised as one of, if not the, greatest C++ book written. It is not for a beginner and he won't get too much out of it until you are ready for it. As I said earlier, the OP already has a number of good books and recommendations and really doesn't need more. I personally would recommend, especially for someone so willing to outlay so much cash on books, to consider subscribing to Safari Books Online. It's 40$ or so a month, but amazing value if you do a lot of reading. I try to get in 4 or 5 a month, so for me it is outstanding value. That said, if you can't read on a screen it may not be a great choice, but myself, combined with my tablet, it is great.
#15
Re: What are some fundamentals that go into making a Tetris game?
Posted 03 December 2011 - 02:57 PM
Serapth, on 03 December 2011 - 09:31 PM, said:
Your perception of how C and C++ is used in games shows a thorough lack of knowledge and experience in game development. If someone wishes to program games in C++, they will be writing some code in C without a doubt! Only the most basic games that anyone can write can you get away with pure C++ (whatever that is!).
All the work I have ever done in game development requires knowledge in C as well as C++. Also, if you go to a game programming interview it is likely you will also be tested on C as well. To dismiss C as a valuable language to learn in conjunction with C++ is extremely bad advice, and is one of the problems I have noticed with student programmers who know C++ to a fairly good level, but have little to no knowledge of C - that knowledge is seriously lacking and causes them problems that people like me end up fixing!
Serapth, on 03 December 2011 - 09:31 PM, said:
I think I just did!
Serapth, on 03 December 2011 - 09:31 PM, said:
Really? Universally praised, pretty much? Okay. So is 'The C Programming Language' yet you dismiss the book as a good recommendation because it isn't a C++-specific book, which in itself isn't the most sound advice. If you are talking application programming then fine, stick with the C++-specific books, but for game programming, and professional game programmer like myself for instance, not knowing C and C++ and not knowing when each is appropriate is a fail.
Serapth, on 03 December 2011 - 09:31 PM, said:
Very wrong. As quoted from the Amazon listing of the book:
Quote
Also look at the table of contents, it starts you from the very basics.
You are assuming your opinion in a field that you clearly have very little experience of to be the truth. It is entirely up to the OP, but I would very strongly recommend they read this book first then approach the C++ one if they wish to write good games sometime in the future, or even work in the games industry.
|
|

New Topic/Question
Reply



MultiQuote









|