very frustrated! trying to make a game

Started by
11 comments, last by jimiwa 20 years ago
OK, I do know how to program in C++. Understanding pointers, classes, arrays, etc. is not my problem here. The problem is I haven''t been able to program a game after looking for over a year for articles on the internet and even after buying a few books. I tried the Direct Draw tutorial on gamedev.net (compiling with Visual C++ .net) and came out with a bunch of errors that I couldn''t fix. I have bought a few books including tricks of the windows game programming gurus. I have looked for tutorials on the internet including directx tutorials and even djgpp and allegro. Allegro code looked quite simple but I can''t build allegro! I just want to program simple 2d games but I can''t find any programming package that will work AND has adequate documentation on the internet. I am VERY frustrated with TRYING and TRYING and TRYING and NEVER getting ANYWHERE! Someone suggested that I learn Direct 3D instead of direct draw so I ordered an ebook version of a 3D game programming with direct X book that is supposed to be very good. I have only gotten this book as a last resort, thinking that I''ll be able to program my 2d games in direct 3d. Why isn''t there adequate documentation on the internet for Visual C++ .NET and Direct Draw? Why can''t I find a graphics game programming library that has clear complete explainations, and why is there such a LACK of complete source code for the environment that I''m working with? I have visual studio .net academic edition but I DONT want to program my games in visual basic because I much prefer visual c++. I would be willing to try some visual c# programming if that''s what I need to do to get a game going. I did program a game in C++ about 7 years ago using Borland C++ Builder and a game programming package but that''s an old compiler, I don''t want to use it, and I don''t know where to get that package. In fact, if I would want to program a game today the only type of game I am actually able to program is a java applet - but what I really want to do is a full screen game using Visual C++ (or C#) .net Is there anyone out there who has some simple complete code like a pong game or something that will work in visual c++/c# .net?
Advertisement
It seems to me that you''re trying to swallow the whole hog here instead of taking it in bites. What I would suggest is to start by figuring out the pieces that your game is going to need (ie, keyboard control, mouse control, drawing, physics, etc) and start evaluating each piece one by one. Just seeing someone else''s code isn''t going to make you understand how to make a game, only taking a calm and rational approach will.

Now, what I would suggest is that you check out www.libsdl.org, as SDL can do all sorts of things for you very, very easily (and its crossplatform, if you care about that sort of thing). Check it out and I think you''ll be pleased with what it can do to help you get started.

P.S. I''m pretty sure that Direct Draw is depreciated (though I''m not entirely positive of this as I don''t code with DX), which might be why you''re having problems finding information on it.

Good luck!
"Game Programming" in an of itself does not exist. We learn to program and then use that knowledge to make games.
First of all, what type of errors were you getting when you tried to compile those DirectX examples? Chances are that they were the ever common linker errors. To correct them you need to include the appropriate DirectX library files into your project (i.e. ddraw.lib and dxguid.lib) and add a path in the compiler settings that points to the library files directory.
"Skepticism.... that great rot of the intellect." - V.H.Bah, what does HE know?Albekerky Software
The DirectX Forum FAQ will hopefully answer your DirectX questions. (If not, please tell me - it means I need to add/change the FAQ.)

The other thing it sounds like you need to do is really learn how to use your compiler/linker. If you do that, then "I can''t get it to build" is unlikely to present you with further problems - you''ll stand a better chance if you can understand the errors and know how to fix them.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Step 1, compile a "hello world" as a console app

Step 2, compile a "hello windows" basic game loop
GameLoop1.cpp | EXE

Step 3, compile a "hello directdraw" basic full screen app
DirectDrawDemo.cpp | EXE

Steps 4 through 99 involves adding to step 3 until you have a side-scroller like Super Mario.

Step 17, a side-scroll demo
Megaman4.cpp | EXE

Make sure you understand what each part of your code does, make sure you are adding the DX SDK at top of your paths, make sure you are adding ddraw.lib to your Visual C libraries (assuming you want to stick with ddraw).

Phil P
Okay, I've made a successful directdraw screen setup before, but
couldn't get past simply opening the graphics mode (i.e. - I
haven't yet gotten to drawing animations on the screen). I will take
this bit by bit of course, but I did scan the megaman code
and I am wondering something.
First of all, I need to know what's in the megaman4.h file -
and second - where is the code going to look for the bmp files?
In megaman4.h? What should be in the header file, and how do
I link the bitmaps to the source?

[edited by - jimiwa on April 11, 2004 5:49:24 PM]
I''ll try to answer them tonight by giving you Megaman4.h

My issue is always "what is the BARE MINIMUM I need to make something work?" So I always use straight C, and do the minimum required for set up. I use global variables like crazy (so very little passing variables to functions required).

All my .h files contain the .bmp or .wav file names, with the resource number. Its the bare minimum you need to add resources (such as .bmp for graphics or .wav for sounds compiled inside the EXE itself).

A little about me: I knew nothing of Windows programming just a little over a year ago. Didn''t know how to go full screen, didn''t know how to plot a point. Knew nothing of graphics in Win32. In a year I made BreakOut, Asteroids, Pacman, and now working on a side-scroller.

You can do it if you know C or C++. My advantage is I''ve been programming since I was about 14 and I''m 38 now. I was "out of it" for most of the 1990s so trying to catch up. Full source for my GDI games (minus .h and resources) here

VazGames.com

Phil P
Forgot to mention: you''ll need a .h and a .rc file. As in Megaman4.h and Megaman4.rc, I''ll put those here tonight. I understand Visual C can make the .rc for you, but I do them by hand in a plain text editor (TextPad).

Then in your Visual C, if I remember right, on the left where it says "resources" you right click on that folder, and do "add resource" and click on the file you created called Megaman4.rc (or whatever) and like magic all your .bmp and .wav files are added and will be compiled within the EXE the next time you do a full compile.

But unfortunately you will keep getting the same error that says "missing main()" since you are trying to compile as a console app not a Win32 app! Just kidding.

This was all new to me a year ago, so you can do it.

Phil P
Try SDL, my friend...

If you can''t seem to get that working, then I suggest you take a breather from trying to be a gamer, focus on school, homework, etc and come back to it in a year or so...

Regards,
Jeff

[ CodeDread ]
If you have sufficient general programming skills then why won''t you just join any game developing team? At least you would not *be frustrated* alone.

This topic is closed to new replies.

Advertisement