   simple games
  hi guys i am very new on these forums and would really like to know where i should start for game programming. i have started doing very simple programs in c++ like helloworld.cpp and simple calculators. and i would like to advance. how do i learn how to make simple 2d games like tetris? do i start buying books? i dont want to just simply look at examples of source code for these games i want to be able to know how to structure the these programs from the top of my head i want to know how to write every line of these very simple games and be able to implement new features and eventually work my way to games like wow (i know its a bit of a high bar but i am possibly thinking that game programming is the career route i am gonna go down)   
  The next step for you I think you should take is to make a "guess the number" game.Have the program choose a random number between 1 and 10, and ask the user to guess which number it is. Once the user makes a guess, the program can display a "higher" or "lower" message depending on if the number is higher or lower than the guess.If the player guesses correctly in 3 attempts, they win, otherwise they lose, and display the appropriate message.Now a new random number is generated, and the game starts again, and the game only ends when the user tells it to.After that game, try creating a tic-tac-toe game, with a computer controlled opponent.Both of these can be made using the console window, instead of using a graphics library, and you can get to grips with some game-centric concepts such as a game loop, without worrying about graphics.After that, i would look into SDL for your 2d graphics, it's quite simple, and use that to make your tetris game.Good luck!;  Hi!First of all you might want to try another programming language. You are going to be able to make games a LOT quicker (I find that I'm easily 20 times more productive) with Python for example. C# is another alternative that people recommend around here. I know about 10 programming languages and I try to avoid C++ at all costs. I don't know why you picked C++ but I just wanted to mention this, because if I were in your situation, I would like someone to tell me.Ok, where should you start? The first thing you will want to do is to learn to program in the language of your choice, before you start worring about game programming. I recommend you buy a book (or find a free one online, there are some good ones) because tutorials are often insufficient. If you are really serious about game programming then you might want go to college and major in computer science or something similar. (I'm from Sweden, we don't have quite the same school system. Actually I don't know about Scotland. :P). I would not have learned nearly as much as I have without going to college.Regardless; when you think you know your language and general programming techniques well enough try to make a simple game like tic-tac-toe or snake or something. And be sure to check out the For Beginners section, this among other things.Good luck!P.S. You should start using capital letters properly, people will take you more seriously!   ;  i know c++ is not the easiest language to learn but it gives you total control in game creation and if i get a good grasp of the basics now then when i go to uni to get a degree in this stuff i will be a step ahead. also i have already created a magic number game. the only problem is that rand() gives you the same number game after game. but i will look into making a tic-tac-toe game :D thanks and i have been looking at sams teach yourself c++ in an hour a day (6ed)but is there any other books you would recommend that will really help me get a good grasp on 2d and simple 3d game programming?   ;Quote:Original post by emforcei know c++ is not the easiest language to learn but it gives you total control in game creationWhich is more important to you right now: total control, or speed and ease of development?Any programmer worth his/her salt will know multiple languages. By all means learn C++ eventually, but I'd recommend checking your priorities for now and deciding whether learning C++ is really the best way to meet them. (Maybe it is! I'm just saying, it'd be good to make sure it's really what you want).Quote:and if i get a good grasp of the basics now then when i go to uni to get a degree in this stuff i will be a step ahead.Arguably, the important basics to learn are the higher-level things like structured programming, data types, and theory of evaluation - the basics you'll learn with C++ are almost too basic. My CS course did teach us about things like while loops and if-statements; they were each one slide in a one-hour lecture in the first week of a 4-year course. There is merit to understanding how the computer works on the lowest levels, but that understanding alone doesn't give one much of a head start in most uni CS courses.Quote:also i have already created a magic number game. the only problem is that rand() gives you the same number game after game.Look into the srand() function. Specifically, the common pattern is srand((unsigned)time())   ;  is here any books you would recommend that would give me a taster of cs course?i dont want a master book more a beginner-intermediate one that i could work from?and i would prefer total control in my game creation.and thanks for telling me about the srand i will look into it more thoroughly :D   ;  Honestly, saying power and control on these forums isn't really worth much.  You aren't going to NEED that power or control with the projects you will be working on as you are learning.  I'm not trying to sound hypocritical considering C++ was pretty much my first language (and I'm STILL learning the basics, after nearly a year), but I would branch off and go ahead and learn Python or C# before you start messing with C++, unless of course you already know how a program really works.And the college I'm going to doesn't even teach C++, yet throughout the program they will give you enough knowledge where you can easily learn it.  They teach C#.   Aren't you at least a little curious as to why they do that?   ;  i have dabbled in c# as i heard its pretty easy but i heard that game developers use c++ and i am considering a career in the industry so i want t try my hand at learning it.   ;  Well, like I said, there's no way of any of us stopping you, but we are just trying to help you understand that you will have an easier time learning it if you have a basic idea of how programs work, and that will be a lot easier with a language that is easier.Also, C++ is hardly any kind of 'industry standard'.  There are commercial games out today written in Python, and if you're a fan of Microsoft Games, they use C#.Keep that in mind.   ;  I was the same way regarding C++. I assumed it was the way to go. Period. Then I took a couple of Java classes and learned that it was just as good in its own ways. It was also a lot easier to learn since I'd already studied C++. I'm sure that would work both ways. If you haven't already started with C++ you can save some hair ripping by starting with something easier. You can always go back later, as has been mentioned. C++ would come much quicker. It isn't like you'd be starting from scratch.   