Here's my tic-tac-toe game. Check it out and tell me how do you like it...
Printable View
Here's my tic-tac-toe game. Check it out and tell me how do you like it...
It's a 2 player game.
The controls are 'arrow keys' to move and 'enter' to mark box
By pressing 'esc' you can exit at any time
How long did it take you to make this, and what did you use to make it, C, C++, what? Im just wondering cause I want to be making some first persons shooters (with a group) sometime within the next year, and I really don't think I will have the skills with all these MS-DOS games I keep seeing in these forums.
I have created this in c++.
It is my second try at the game.
In my earlier attempt the players had to use numbers 1-9 to mark the blocks and 0 to exit the game as the winning condition was not coded.
In this try i modified the basic code i had used to use bioskey() for arrow movement,esc etc and also provided the winning condition check.
It is quite easy to make it if you just break each move or condition and do the coding accordingly.
So do i assume you like it... and check out this another game i have finished.
Hi,
I liked this program.
Any chance of seeing the source code to learn from?
Regards
not bad at all.
slick: if you think this is better than stuff that you can produce, then you definitely need abit more practice before hitting the game programming scene.
if ya want a mentor, feel free to write questions to me directly ([email protected])
cheers.
U.
very nice. i have a similar tic tac toe game, actually almost exactly the same except you have to use the keys 1-9 to choose a spot. i used a switch/case statement for it. how did you do it as you did where the blinker thing moves around to each spot? also, unlike most peoples tic tac toe, mine has a computer option with nice AI. i'll post it in a little when i get to use my other computer with my projects on it. so how did you do it?
Pretty good. How did you check the cursor buttons?
to use arrow keys, esc, enter etc use the bioskey()
its in bios.h
the bioskey function gives the keyboard code for the keys entered by you, like...
****
int key;
key=bioskey(0);
cout<<key;
****
if you pressed 'enter' it would have displayed 7181, and now by using switch you can use for arrow keys etc.
***
switch(key)
{
case 7181:
//your code for enter
case 3592 // backspace
// your code for bksp
***
heres a program i made to provide some help to you all.
in it you can use --
the 4 arrow keys, esc, pgup, pdown, home, end keys to move the cursor on the screen
Why may i ask that when i compile the cursor.cpp program in
borland 4.x (on the WIN/GUI) or at the
command line with bcc32 cursor.cpp
I get these errors :
Error cursor.cpp 24: Call to undefined function 'bioskey' in function main()
Error cursor.cpp 32: Call to undefined function 'sound' in function main()
Error cursor.cpp 33: Call to undefined function 'delay' in function main()
Error cursor.cpp 34: Call to undefined function 'nosound' in function main()
but using (at the command line)
bcc cursor.cpp (NB : no 32 on bcc cmd)
It works fine ?
I get these errors sometimes and if someone can solve them, well, i'd appreciate that
Thanks in Advance
i made the program using turbo c++ ver 3 of borland and it ran perfectly.
i am not sure why you are getting those errrors but i think it maybe related to the header files
dos.h since sound, nosound, delay belong to it
bios.h as bioskey is in it
maybe you don't have these two files??
check and let me know, i'll give.
Borland 4.x does have those header files, but possibly since it's a windows compiler and not a DOS compiler it may not work, it did work using DJGPP.
Did you use borland to compile at the command line ?
if so what command ?
thanks,
I can get the cursor.cpp example file to compile under borland 4.5 from the IDE by right clicking in the work space. Then clicking on the option TargetExpert. Change the Target Type to Application and then change Platform to DOS. I do not know the command line for this.
Was able to compile it on the command line that you tried and it worked for me.
Excellent, Thanks lambs4