can someone give me a small code for a simple dos game
so i can see what functions and modes there are and how to use them
i'm not a beginner but i think i'm stuck, and i need help to improve myself
any help would be apriciated, thanks in advance!
can someone give me a small code for a simple dos game
so i can see what functions and modes there are and how to use them
i'm not a beginner but i think i'm stuck, and i need help to improve myself
any help would be apriciated, thanks in advance!
If you are tryin to use graphic.h
GOOD LUCK!!
What is C++?
lol what's the problem
cna u show me some codes that u have perhaps we can help eachother
I cant even get that to work... It says make failed and gives no reasonCode:#include <iostream.h> #include <graphics.h> int GraphicsDriver; int GraphicsMode; int main() { initgraph ( &GraphicsDriver, &GraphicsMode, "" ) circle (5, 5, 10 ) cin.get(); return 0; }
What is C++?
in this case i see u have forgot to put ;
after your functions
but i also looked at your previous code
and found that it gave u errors with the ;
i think your problem is when u open a new file u should just choose BGI nothing else i dont know how it looks like in yor borland but in my u can choose one thing called no exceptions
dont choose that one just choose BGI!
oops. i just forgot the ";" on my post
Any who I pick Dos(Standard) and pick the BGI Library.. nothing else.
What is C++?
do u save your files as "ide"?
example file1.ide
what is the Red Dragon Syndicate?
Yah.. ide is what i always use...
Must not have seen Cowboy Bebop... Red Dragon Syndycate is off of an anime
What is C++?
see if this works:
Code:#include <iostream.h> #include <graphics.h> int GraphicsDriver = VGA; int GraphicsMode = VGAHI; int main() { initgraph ( &GraphicsDriver, &GraphicsMode, "" ) circle (5, 5, 10 ) cin.get(); return 0; }
Error:
Line 11,11 Statement Missing ;
What is C++?
Even if I put ; on the end it runs and says
BGI Error: Graphics not initialized use 'initgraph'
What is C++?
I've tried this with your example and got to work.
initgraph ( &GraphicsDriver, &GraphicsMode, "<path to bgi directory>" )
initgraph ( &GraphicsDriver, &GraphicsMode, "c:\\bc45\\bgi" );
Lamb.. I love you...
You have solved the problem I have had for a month...
THANK YOU SOOO MUCH!!!
So you know any thing about graphics.h? Like how to change the background or make game items.. like make a circle and make it move?
What is C++?
I know a little about graphics.h, but thats about it. By background do you mean the color? Cause that's all I know and that's by using setbkcolor().
Here's some code that modes a circle
Code:#include <graphics.h> #include <stdio.h> #include <conio.h> int main() { int gdriver = VGA, gmode = VGAHI; /* sets graphic mode in VGA 640 x 480 */ int x = 20, y = 20, quit = 0, move; char coord[10]; /* coordinates */ initgraph(&gdriver,&gmode, "c:\\bc45\\bgi"); while(!quit) { sprintf(coord,"x: %d y: %d", x,y); outtextxy(1,1,coord); /* outputs coordinates */ move = getch(); /* gets input */ switch(move) { case 'd' : x++; break; case 'a' : x--; break; case 'w' : y--; break; case 's' : y++; break; case 'q' : quit = 1; break; } cleardevice(); circle(x,y,10); } closegraph(); }