Sunday, March 31, 2013

Car race game in c++










Have you played this came before...
I have created this game in C++, Simple and sweet game.






Nice car game in C++ using Borland Turbo C++ Compiler.
Set BGI Graphics path in initgraph() function according to your pc's Trubo C BGI library.
Here mine is c:\\turboc3\\bgi.

Keyboard Controls to play the game ;
Controls
A - Move car left
D - Move car right
Enter/ESC to exit the game.

If your compiler's graphic library is not included then you will find many errors in this program.
To avoid this follow the steps:
1. Go to compiler's option menu (ALT+O)
2. Then select Linker option
3. Then select Libraries option
4. Then Mark X to Graphics Library option using space button
5. Then select OK

All done.
If you want to save this changes permanently then do this:
1. Go to Option menu
2. Select Save then select OK


Still having problem then ask me or comment below.
Enjoy the Game.

14 comments:

  1. i compiled it in turbo c++ and it says that if and do are not expanded inline and that f is assigned a value that is never used. please check.

    ReplyDelete
  2. These are just warnings, ignore them.

    ReplyDelete
  3. i run this ion ms visual 6.0 c++ and got an error saying "fatal error: cannot open file: 'graphics.h': no such file or directory"

    ReplyDelete
    Replies
    1. Graphic.h is not supported in visual studio, try Turbo C++ compiler.

      Delete
    2. no error but my turbo c++ cant run it!
      im getitng "ctrl+break to quit" then freezes! >_<

      Delete
    3. Which OS you are using and which version of Turbo C++ ?

      Delete
    4. windows 7 32 bit and turbo c++ 3.0!
      im a newbie on programming so i dont really know what im doing! >_<
      i also have dosbox 0.74 coz' i read that it is needed by the turbo c but when i tried it, it gives me "link error"

      Delete
    5. https://drive.google.com/file/d/0BxIpGO4jy_1PMFROX2s5Z1hwMmM/edit?usp=sharing

      Try this

      Delete
  4. On compling this error is showing
    Graphics error: Device driver file not found (EGAVGA.BGI)
    Press any key to halt:

    ReplyDelete
    Replies
    1. Set BGI Graphics path according to your pc's Trubo C BGI library.
      Here mine is c:\\turboc3\\bgi.

      Delete
  5. error BGI graphics not supported under Windows , what should i do

    ReplyDelete
    Replies
    1. In Turbo C++, it is supported. Check Initgraph method BGI library path first. If you are using any emulator like DosBox to run Turbo C++ then path may vary than the original.
      For Turbo C++ compiler goto to Options (ALT+O)
      Then goto Directories
      If path for Include Directories is C:\TURBOC3\INCLUDE
      then your BGI path will be liek C:\\TURBOC3\\BGI

      Delete

Powered by Blogger.