views:

871

answers:

7

I installed visual studio 2005 in my machine and i want to start polishing my c++ skills and i thought of doing a simple game eg. space invaders!

What am wondering can i do the whole game using just vs2005 without any other external libraries?

Any simple examples/links out there that have used plain vs2005 to create simple games?

Gath

A: 

By my knowing VSC++ is nothing special but a way to code/build etc. So yes this should be sufficient to make a game. If I were you I would start by searching games in c++ online and download their source code. Scan it for common strategies/designs and run one to test if your VSC++ is set up correctly. After that start programming your own game.

//edit
Sites like this one are freely available online for source code etc.

bastijn
A: 

I used to make side scrolling shoot-em-up's using GDI+ - I got about 20 to 30 frames per second animation, looked pretty good (this was in Visual Basic .NET, btw). Experiment with the TextureBrush class - that's the secret to easy & fast animation.

My knowledge is a bit dated, however. No doubt you'll get people here saying you should download the Express Edition of Visual Studio 2008 and play around with WPF (probably not a bad idea, though I've never touched WPF yet).

Cybis
A: 

I would consider using external libraries if you plan to create anything more than simple text based games, as you need some way to display objects, control them, you probably can write all this stuff on your own, but I feel you would probably gain much more using some libraries like SDL http://lazyfoo.net/SDL_tutorials/index.php, some good tutorials there to get you started if you choose to take this path.

if you want to write your own functionality, it is possible to directly edit the bits of a SDL surface, so it can provide an easy medium to setting up a window, and receiving input, whilst still giving you control over exactly what pixel is doing what

Stowelly
I didn't use any external libraries - he's programming in .NET, remember. You just load the images you want to use into TextureBrush objects (I had a different bmp for each frame of animation for each sprite), then you can flip through them or move them around in your main loop (the main loop is based on the Paint event calling Invalidate, which raises Paint again). It isn't too difficult to get set up one you have the artwork and animation is reasonably fast.
Cybis
Just be sure you set "DoubleBuffering" to True on your form.
Cybis
+1  A: 

The majority of Windows games these days use Microsoft's freely-available DirectX SDK. The SDK itself comes with a extensive help files and tutorials that should get you going.

Rather than use C++, however, I would recommend a beginner to use XNA and C# to learn the concepts.

saw-lau
A: 

After you develop your simple game without libraries, you may consider looking at the Qt libraries to see what they can do for you, since they will do a lot of the boilerplate legwork for you, in this context. You also have the added advantage of being able to develop cross-platform, rather than needing to port later. Qt can be found here: http://www.qtsoftware.com/

byte
+2  A: 

My answer is "Yes". But, it's not just using C++ with VS. You need to learn Windows programming by using Win32 APIs or MFC to handle user's input(windows messages) and graphics (GDI) for game development. If you want to make games more seriously, you also need to learn DirectX which is a set of APIs to handle multimedia programs (including games) much more efficiently.

So, if you simply want to make a game like "space invaders", it might take a long time to start actual gameplay programming since you need to learn all those basic stuff. There are more convenient framworks for developing this kind of games such as pygame (python) and xna (C#). It depends on your intention of the project and time constraint. Good luck!

young
+1  A: 

Yes, you can produce a simple game with C++ and vs2005 without any other external libraries. On the other hand it would be faster and easier to use some external libraries especially for the graphics, controls and sound or you will have to duplicate that functionality yourself. (If you have no particular reason to use vs2005 you should get the most recent compiler)

If your problem is getting sidetracked from C++ and lose some time learning some libraries APIs even then it will be faster and easier, that or keep your programming projects to something simpler until you feel comfortable with the C++ language. Another issue is planing, if you do have a project write down a skeleton of how you intend to go about it first, select the bits you don't have the know how and research a bit first before starting with the code.

As for the selection of external libraries you will be best served if you can stay away from platform dependent code/libraries even if it seems more complex (in the long run it will be more useful for you), as an quick example you can trade DirectX for OpenGL the later is a bit more complex but more portable but it all depends on how complex you intend to be on your game you can select a more general graphics engine (Ogre 3D http://www.ogre3d.org/ LGPL) and somehow bypass that low level knowledge (learning the basics of OpenGL would also be a well invested time even if you do skip direct use of it).

You should select external libraries based on the freedom they provide you (license and portability needs) and stability and maturity. Avoid closed source if your aim is to learn and have deeper control, or GPL since it restrict you to produce GPL code (understand the licenses). You should also avoid platform dependency...

Panic