   programming Directx in a game
  This may seam to be a stupid question but I am going to ask it any way.When people are programming games are they just copying the code and rearranging it or is there some way to make the code individual to each person? Or is there some kind of format to follow that I am not aware of?I know there is structures of every Direct x object that you could fill out by just plugging in the right stuff but that is not what it looks like the books are doing. Or it is but I am just not seeing it..The reason I am asking is because I have been working through a couple of books to program games but all they have is there own cores of each group. Or you may call them objects, library’s, engines. They also do not really say how to take the core and modify it for your own use. I am just running into a brick wall here and seam not to be able to understand what to do next. I just keep reading and rereading the direct x part of the books but all I am getting is how to make a single object and not multiple objects all at once ect.I can make a windows window. That is simple. I can also put a direct x image up and a box and a few other things.But I want to be able to make objects like a room. But I can’t figure out how to make a core of my own then make objects "classes" in separate files and then make a main object to put them all together.There is just something I am missing. I can make functions no problem I even know how to make classes. But I don’t know how to implement all this with direct x. I ran through tuts but they just show you one piece and then another but not how they all work together as one.If you want you can just email me at Jeremy_King@dell.comTo explain how this is all spouse to work. 
  I know what you''re talking about. You can read a tutorial, and then you know how to do what the tutorial taught you to do... but you can''t do things that tutorials haven''t explicitly taught you to do.This is the hardest thing a programmer will ever learn, because no book can teach you to do it. The only way to learn it is practice, and experience.Start small. Make a text-based game, like guess-the-number, without using a tutorial. From there, work up to larger projects. Get to be a good programmer, to be able to analyze a problem and decide what steps to go about to solve it.With every problem, you should ask yourself: What are the fundamental steps involved? What information is needed, and in what format should I maintain this information? What structures are present in the information, and how should I represent them? These questions are intentionally vague, because answering them should become instinctual. During all of this, you may want to limit your use of outside APIs like DirectX. They''re essential to know, to be sure, but you shouldn''t bite off more than you can chew. Take it a step at a time.Oh, and good luck.  "Sneftel is correct, if rather vulgar." --Flarelocke ;  Thanks For the advies I will try that. ;  I have done my fair share of copying and pasting, but after doing it for a while you suddenly realize how useless it is. You then spend another month or two completely lost and helpless.And then it all clicks.Just give it time, make sure you completely understand what you read. Experiment with sample code and try building off of it to make it do what you want to do. Do things like "this time I will get that triangle spinning  " and then "now I''ll make it a pyramid   spinning ". Soon you will be up to "now I''ll move that model of my ship around the screen" and eventually will have something mildly interesting. By that time all the pieces will come together. ;  Oh, and one other thing. The programmer seeking to make The Great Video Game Of Our Century has two allies that are woefully underrepresented in most tutorials: Structures, and Loops.Structures are your friend. Whenever you have data that should go together, it should be in a struct or class. Does your program have variables for the x and y location of the player? Stick ''em in a PlayerPosition struct or class! Does more than one thing have a position? Make a general Position class, and use it wherever you need an X and a Y! This is closely related to abstraction and polymorphism, concepts which have been around since long before OOP.Loops are your friend. Too many tutorials look something like this:DrawPlayer();DrawTable();DrawChair();DrawBadGuy();  ..when they should have:for(vector<Drawable>::const_iterator id = currentScene.drawables.begin(); id != currentScene.drawables.end(); ++id){    (*id)->Draw();}  The second way is somewhat harder to follow, and requires more code, but it''s also a lot closer to a "real engine". It provides a strong decision about what''s data (the list of objects in the world) and what''s code (draw each object in the world). That differentiator is crucial, since it keeps you from having to munge up your code as your game grows.A little more information here.   "Sneftel is correct, if rather vulgar." --Flarelocke ;quote:Original post by Raloth  I have done my fair share of copying and pasting, but after doing it for a while you suddenly realize how useless it is. You then spend another month or two completely lost and helpless.And then it all clicks.I love the feeling when it all clicks.  You just wake up one day and you can just ''do it'' like you knew all along.