| Back in 1996 when I was learning C, disconnected from the rest of the world without an internet and no one to help me with and no books that decribed concepts of C in detail, I tried my hand in trying to make my own version of games like digger and dangerous dave. In the process of coding this game, I came across problems to which I couldn't find solutions and eventually gave up on game programming. Since then I have been into other things and I now want to start off from where I left things previously. Following are the issues that I faced when making the game: 1) The program code was linear and used a shitty switch/case construct to take keyboard inputs and call functions that would move my character on the screen. However, since moving the character meant redrawing bitmaps on the screen, a lot of CPU cycle was spent on this (on a 486) and I wasn't able to get fluid motion from other objects in the game screen. For eg: I would have a moving paddle that I need to jump on top off. However to do this, the paddle should move independant of my character. But if I pressed and held an arrow key to move the character, all CPU cycles would go into moving the character and then the CPU would have to wait for no inputs from the keyboard to move the other objects in the game. I was never able to get things work independant ofone another. I now know that the solution to my problem is threading but I am not really sure how to create threads that have functions in them and call them. It would be nice if someone can point me to a beginners tutorial on threads that addresses the kind of problem I am facing. 2) I was always amazed at how games like dave and such had more colors than the 16 colors Turbo C would allow. I have now come to know that int13 is used to gain access to a larger color pallete. However the usage seems very confusing. Any links that can give me a good insight into this? 3) Considerable amount of CPU cycle was spent drawing bricks and blocks on the screen. I figured the way games did it was use tiles and replicate them. How do I get any bitmap I create to come up on the parts of the screen where I want it to? Are we doing a direct frame buffer write, if yes, how do I gain access to the frame buffer and what are its controls? I am not a CS major and nor do I obviously code for a living but I would like to get back into it seriously. Any help is appreciated. Thanks. |