Thread: Starting to program games in visual c++

  1. #1
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753

    Starting to program games in visual c++

    Ok, I have this book called How to Program C++: Third Edition. By Deitel & Deitel. That is my tool. Using that book, I want to learn all I need to know about C++ to start to make a game. I use MSVC++ 6.0.

    1) Can you program games with MSVC++ 6.0?
    2) Is there any difference between c++ and visual c++?
    3) What all should I learn from my book about c++ that will enable me to make a simple game like galaxian, or even simpler. So far I know all the basic stuff, functions, void stuff, arrays. What else should I learn before trying to do a simple game?

    Please answer my 3 questions, especially #3. Thank you.

  2. #2
    Bobish
    Guest
    1)yes
    2)as with all compilers they have there own fetures that makes them diffent but it has all of the base C++ header files and uses the same language
    3) Okay first learn almost all of the C stuff and atleast have a basic undersanding of c++ stuff. Then try learning a bit of windows api, after that , you probaly want to learn Direct draw for 2D graphics or Direct 3d or open GL for 2d graphics. It also posible to make a consle based game but that take a lot of work.

  3. #3
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753

    But...

    I think of the C language to be outdated and old. I thought that c++ had everything c does plus more. Do I really have to learn c? Am I able to make games only learning c++ and then direct x 8?

  4. #4
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    first off C is NOT outdated and never say that - lest you be smacked!

    no, you don't HAVE to learn C, but it'd be nice...

  5. #5
    Registered User dirkduck's Avatar
    Join Date
    Aug 2001
    Posts
    428
    C++ has more...'features' if you will, but C is a little faster.

  6. #6
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753

    Yes...

    But, my main question: Am I able to make games with ONLY my MSVC++ 6.0, learning c++, and direct x 8.0a SDK (137mb)? One more question: Can I program games in visual basic, because I'd be a lot better using basic, for now at least. I'm much more familiar with basic. So please answer the TWO above questions, thank you.

  7. #7
    Registered User
    Join Date
    Oct 2001
    Posts
    375
    Yes and yes.

    C++ is C with object oriented design tools. You do stuff with C, you design it with ++. Outdated is irrelevant, as a language controls computer hardware. Only computer hardware is able to be outdated. Some people believe designs are outdated but that is a matter of what you've learned, what works best, and your own personal taste. C++ takes C and adds even older design concepts. So in a way, C++ is older than C.

    BASIC will make games, just not professional high performance games. I would recommend you learn the language (C/C++) that you can go the farthest with instead of.. dare I say.. wasting your time on BASIC.

    Visual C++ is visual because you don't type into a DOS prompt. Yay. MSVC++ uses C++. Direct X will allow you to (eventually) create 3D or 2D games with full screen or windowed modes, with sound support, input device like joystick support, and network support. The con: only works on Windows OS's. That may not concern you, of course..

  8. #8
    Unregistered
    Guest
    Originally posted by Justin W
    Yes and yes.

    C++ is C with object oriented design tools. You do stuff with C, you design it with ++. Outdated is irrelevant, as a language controls computer hardware. Only computer hardware is able to be outdated. Some people believe designs are outdated but that is a matter of what you've learned, what works best, and your own personal taste. C++ takes C and adds even older design concepts. So in a way, C++ is older than C.

    BASIC will make games, just not professional high performance games. I would recommend you learn the language (C/C++) that you can go the farthest with instead of.. dare I say.. wasting your time on BASIC.

    Visual C++ is visual because you don't type into a DOS prompt. Yay. MSVC++ uses C++. Direct X will allow you to (eventually) create 3D or 2D games with full screen or windowed modes, with sound support, input device like joystick support, and network support. The con: only works on Windows OS's. That may not concern you, of course..
    MFC is visual, comparable to VB...

  9. #9
    Registered User
    Join Date
    Aug 2001
    Posts
    411
    With MSVC and MFC you can do anyhting you can do in basic. But it also opens many more doors.

    Just start by learning the C/C++ Syntax.

  10. #10
    Registered User Zeeshan's Avatar
    Join Date
    Oct 2001
    Location
    London, United Kingdom
    Posts
    226
    Best Steps 4 doing what you want to do :

    1. Learn all C++ syntax.

    2. Learn how to program windows programs (they're completely different from the DOS or console mode applications), better learn both the Win API and a little bit of MFC.

    3. Learn OpenGL (the best grafix engine ) See the pole on whether opengl is better than directx on this board.

    4. Learn a bit of games programming techniques (e.g. BSP trees etc.)

    5. Write your first game and give me all the credit for it

  11. #11
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753

    I...

    I have to learn ALL of the c++ syntax? You mean go through the WHOLE 1000 page book by deitel and deitel? ALL of it? Also, should I bother at all with Visual Basic? I got MSVB for free, so I'm just wondering. But, learn ALL of the c++ syntax? And one more thing: I think this book I have by deitel and deitel (called How to Program C++) has errors in it. The syntax is wrong, i think. For example, they include header files that don't work, like cstdlib. Also, for their including header files, the syntax there is wrong. for example it says #include <cstdlib>. Just like that, no '.h' or anything, and that header file doesnt exist anyways! Also, for if statements, it says do this:

    if (a==5)
    !Do all the stuff here
    else if (a==7)
    !Do all the stuff here

    And there are no braces ({})! In their examples, it appears like that with no brackets/braces. Something is definitely wrong with this book man, could you guys possibly reccommend a good one?

  12. #12
    Registered User
    Join Date
    Aug 2001
    Posts
    101
    Something is definitely wrong with this book man, could you guys possibly reccommend a good one?
    Deitel & Deitel's book is considered by many the best available.
    Also, for their including header files, the syntax there is wrong. for example it says #include <cstdlib>. Just like that, no '.h' or anything, and that header file doesnt exist anyways!
    That's correct, there is no .h at the end. The C++ Standard says there there is no .h at the end of the header files of the Standard C++ library and that all of the header files of the Standard C library get a c added before their name and the .h removed. By the way, MSVC does have these new headers, so why do you say they don't exist?
    And there are no braces ({})!
    Braces are only required if you want to have more than one statement executed for the if/else/while/do/for statement and even then you can use the comma operator.
    - lmov

  13. #13
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753

    whew!

    Thanks, I thought I was going to have to get a new book. Now I'll be able to continue with it. But, again, must I learn ALL of the syntax and go through the WHOLE book before doing a game? Also, one more question. How do you declare a global variable that keeps its value?

  14. #14
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    You won't have to know everything in the book to create a game, but unless the game is to be pretty simple you'll need other books/tutorials aswell. What type of game were you planning on making?

    If you create variables in global scope (not within functions or classes) they'll keep their values.
    zen

  15. #15
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753

    I wanted to start out with...

    I was thinking perhaps a game like galaxian or something like that. Maybe even simpler. Just something like that. Also, I need a bit of help, please read my post called "Yay! My first game! Come look!". It's a tic tac toe game. Please help me on it, it works, theres just a few bugs.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  2. Errors with including winsock 2 lib
    By gamingdl'er in forum C++ Programming
    Replies: 3
    Last Post: 12-05-2005, 08:13 PM
  3. question about .net to 6.0 change causing errors
    By jverkoey in forum C++ Programming
    Replies: 17
    Last Post: 03-23-2004, 10:45 AM
  4. odd errors from msvc std library files
    By blight2c in forum C++ Programming
    Replies: 6
    Last Post: 04-30-2002, 12:06 AM
  5. Replies: 2
    Last Post: 11-08-2001, 08:42 PM