Jump to content
  • Advertisement
Sign in to follow this  
garyfletcher

1st game - newbie looking for feedback.

This topic is 4967 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all I've just completed my 1st game. It's a simple text based version of Tic-Tac-Toe. I'm pretty new to this C++ and OOP development, I come from a C development background and so would really appreciate some feedback on the design and other areas of C++ & OOP that I've used or missed or missused. Any constructive comments would be good, be they good, bad or ugly. The source can be downloaded from here Thanks to ace_lovegrove for helping me with webspace...top man..:) The project has been built using dev-c++ v4.9.9.2. Please get back to me if you wouldn't mind. Thanks in advance..:)

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by ZadrraS
Can you upload a compiled exe file? It doesn't compile with Visual C++.


Seconded - I had some severe issues with both VS and DevC++ - also, why have it in two nested zip files???

Share this post


Link to post
Share on other sites
Firstly, no std namespace needed in Boardtile.cpp and you need a return value at bool GenericPlayer::setGo(const bool turn).

*looks at game*

The GUI and such is very well layed out and frankly kick ass :P

As for the code, you have lots of accessor methods such as
char GenericPlayer::getPlayPiece()

that only return a value. You should place them in the header file so that they will be inlined. Although Im sure a decent compiler would anyway. other than that everything seems fine from a quick skim of the code.

Oh one last thing, isntead of writting vector<BoardTile*>::const_iterator and such all the time you might want to typedef it to something shorter and more easily remembered.

Share this post


Link to post
Share on other sites
I'm not much of a OOP programmer so without looking at the code closely I think this game is pretty damn good. One question though. Is it possible to win? That always seems to be the problem with tic tac toe games. What about cpu vs cpu? does one ever win? Sorry I didn't test it for too long :)

Share this post


Link to post
Share on other sites
Thanks for all the responses and feedback.

Good point about using typedefs for short hand.

I'm suprised taht the compiler didn't complain about the missing return in GenericPlayer::SetGo() function. Changed that now so return type is void. Also will remeber to inline functions. C++ does offer some great functionality when compared to C, am suprised just how much I'm enjoying programming again. Am looking forward to starting to play with templates and some more advanced features liek automatic memory management and class factories...but is better to learn to walk before running.

Will look into a clear screen function.

One thing I was trying to do was overload the << operator to display the board. I did write this as a friend function to the Board{} class but was then getting probelms. The memory address of m_Tiles was being displayed and not the board itself, and then the bit that takes input from the manu would loop infinitely..did wonder if I needed to have a cin.clear(), but as I understand it that function only clears any errors that have occured during the last use of cin? If anyone couls help out with this would be more than appreciated.

For people having problems compiling the project then the executable can be found here.

Am not too sure why the files are in 2 zips, that'll be down to the lovely peeps that helped me get it onto the web.

Thanks for the feedback, please keep it coming.

Share this post


Link to post
Share on other sites
Quote:
Original post by sand_man
One question though. Is it possible to win?


Quite easily. In fact, if you know what you're doing, it's impossible for it to beat you.

Looks quite well made, and I didn't find any flaws in the program. I havn't looked into the code, as my download of the source seems to be corrupted (the files had gibberish).

Perhaps the computer could go first sometimes (Human vs. Comp) to add a little more challenge? I'd also be interested to know if the computer can indeed defeat itself - it appears to play an identical game (resulting in a tie) every time?

Share this post


Link to post
Share on other sites
I like it, very cool...

Have you thought about clearing the screen when you enter a game, after you have a go etc. ?

Cheers,
Add

:EDIT: Doh! someones already said it, :EDIT:

Share this post


Link to post
Share on other sites
One thing i must say, is it has really smart AI, most games at this level just have AI that tries to put 3 in a row with no blocking what so ever.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!