• Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Tic-Tac-Toe in a day

Sign in to follow this  


So today I had some spare time so decided to make a two player game of Tic-Tac-Toe. In all it took 8 hours but I was watching Criminal Minds whilst doing it. I have given the game winner screen and a play again screen which is about all that a game like this needs so I consider it complete. On the way I had a few problems like it kept saying I had an error when glGetError was used which turned out to be this beaut// had to add this is as GLEW was giving me an unknown enum error(1280) :(for(bool empty(false);!empty;){ GLenum err(glGetError()); if(err == GL_NO_ERROR) empty = true; else if(err != 1280) std::cerr << "ERROR I REPEAT ERROR: " << err << "\n"}
As the comment says it was throwing up an error code of 1280 which is an unknown enum error! Turns out this is a common problem one which I personally haven't ever come across so took a bit of time and a shed load of std::cerr's. Most of the other problems were unused variable warnings from callback funtions so I put a few things in to block these out such asvoid Resize(GLFWwindow * window, int width, int height){// really no point in window apart from killing the issue message of unused var if(width == height && window) { glViewport(0, 0, width, height); }
There was one more annoying error in that none of my play again screen would render right but that was because I passed the wrong value into it. Instead of passing the playing area i passed player this took an hour to solve which is alot longer than i wanted it to take but hay ho.

I might at some point add a computer player in to this game but that wont be today or tomorrow! If I do it will have three difficulty levels of easy, medium and hard. All in all I have enjoyed this although it isn't the best looking game ever I never have been much of an artist and it is Tic-Tac-Toe. If you wish to see the game/code it is on GitHub

Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement