Jump to content
  • Advertisement

-JetSirus-

Member
  • Content count

    177
  • Joined

  • Last visited

Community Reputation

158 Neutral

About -JetSirus-

  • Rank
    Member
  1. -JetSirus-

    TicTacToe... Sorta.

    Quote:Original post by Samsonite It was interesting until I realised that I was reading about a total n00b who tried to make a menu system OOP. [grin]. Hey! I greatly resemble that remark! *insulted* [grin]
  2. -JetSirus-

    TicTacToe... Sorta.

    Ok, if you read my previous entry you will note that I am working on a totally stellar adaptation of TicTacToe for the console. After running across a heap of issues I have decided to flex my class making skills. First I need to figure out what classes I need and how they will relate to each other. What exactly am I going to be doing in its simplest form? o Displaying a Main Menu. o Displaying a Game Menu. What does Main Menu have? o Some options to choose from. o Accept some input. o Do stuff with that input. Does all of that need to be in one class? Is a class even needed? Good question. Let's lay out some pseudo code. class MainMenu { void dispMnu(); void getInput(); string parseInput(); } Ok, semi sexy I suppose. We are defiantly missing something. Aha! Private variables to store junk in. class MainMenu { public: void dispMnu(); void getInput(); string parseInput(); private: string menu; string input; } Sexy! I think we can make 'string menu' a little better though. Let's make that sucker a constant. Which I have been told is way better. Some even say its better than being rich. I like to collectively call those people idiots. class MainMenu { public: void dispMnu(); void getInput(); string parseInput(); private: const string menu = "->TicTacToeTicTacToe\n(1)New Game\n(2)Quit\nChoice:"; } Titillating as you can see. Probably won't compile because CPP hates me, but it's worth a try at least. Now let's make 'void dispMnu()' shoot some fireballs or some such. MainMenu::dispMnu() { std::cout
  3. -JetSirus-

    Hmm... OOP?

    Well, after a few weeks of working with CPP I am starting to get the hang of things, to an extent at least. A problem I am often confronting is my complete disregard for an old and true saying, KISS, or Keep It Simple Stupid. I tend to so over complexify even the most simple of programming task that I loose track of my original goal. To this extent I have decided to completely scrap my ever so awesome rendition of Classic Tetris. By awesome I mean merely OK, and by merely OK I mean total crap. It does however look awful sexy in full, awe inspiring system text. But I digress. In it's current state it uses many functions, separate .h and .cpp files and whatnot. Sadly though, not a single Class is used. I'm gonna have to look into inheritance some more before I am fully comfortable with Classes. As it stands, I get this almost school-girl giddiness while thinking of making a monster Class that does everything I could ever imagine. Including foot massages. On the other hand I hate getting slapped around by the CPP god's for such travesties, so I will have to KISS it. Bleh... Bad pun. For the moment I need to come up with a more user friendly form of input. Currently I use a Row/Column system. Rows being 0,1,3 and columns being A,B,C. It gets hairy when the player chooses a square. Enter 'a0x' for example and viola a shiny new 'X' appears in the top left square. While that's completely understandable for your standard Harvard graduate, I get a feeling that little Timmy will either wet himself or start crying when trying to piece it all together. Perhaps both when the game crashes. I will post another update soon. For the moment though I leave you with the following: if(KISS == FALSE) { myHead->Explode.Wait(3); }
  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!