C ++ code for a rifle shooting game

I am looking for C++ code for any simple rifle shooting game. It should be something like a rifle at the bottom part of the screen and the targets appearing at the top part of the screen, with the aim of the game being to be able to shoot the targets before they disappear of the screen.  The key is that the game should be as simple as possible. The simpler the better.

Thanks in advance, psychdrum
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
psychdrumAuthor Commented:
Thanks for the link. We are trying to compile the code with Borland C++ and we are getting the following compile error: [C++ Error] laser.cpp(5): E2209 Unable to open include file 'GRAPHICS.H'

Please advise us on the possible reasons for this compilation error and what we might be able to do to fix it.

Thanks, psychdrum
Andrew BeersTechnology LeadCommented:
More often than not it is easier to learn how to write the code yourself:

You download code written by someone else when it comes time that you want to change the code around to fit your own needs you will spend more time working around the authors quarks than you would writing it yourself.  What you are asking is a beginner / novice level project and would be approximately 2k - 3k lines.  (Trust me, most of it is just formatting and building the OpenGL structure.

If you would like help learning how to actually write OpenGL programs and design your own interfaces feel free to ask here.  We are always more than willing to help.

Plus for pre-written games try nehe.gamedev.net

It's the pinicle site currently for openGL tutorials and code sources.  (Plus most of the examples are for multiple compiler platforms.. There are minor differences in linking for openGL for different IDE's.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Computer Games

From novice to tech pro — start learning today.