   Framework conversion
  Now, before I start this, I'd like to dispel any assumptions that I'm idly rewriting all of my code with some unrealistic expectation that my game will become better as a result of it.  I've written a complete game engine that runs underneath a perfectly playable game, so I'm fully aware that "if it works, it's fine" depending on the situation.  This rewrite is the result of a desire to nail object oriented programming as well as C++, and become way more comfortable with it than I am at this point.Now, I've coded a game that runs perfectly well in the language in which it was written.  However, I'd like to port this game over to C++, as this is not only a much more popular language in the programming world than BASIC, but it would also force me to become very acquainted with C++.The wall I've hit isn't actually related to C++ programming itself however, as I'm fairly confident with the syntax.  It's the object oriented programming and framework, or possible lack of, that I'm unsure of how to begin converting.  At this point in time, my game is almost entirely reliant on global variables, and other techniques that, while fitting for my own needs, would be frowned upon in a more team-based setting.  Here are the "big" parts of my game that I know will need to see changes.NOTE: Keep in mind the reason I'm writing this in the first place is because I'm not sure what I want to do.  If I say something like "I want my engine to be so flexible that a sound effect and an entire map file can share the same class", call me out on it and give me something reasonable.Overall Game Engine.  My game is currently entirely reliant on global variables.  The game state is a global variable.  The entity classes are stored in a global array.  The textures are also stored in a global array.  Game modes, menu selection cursor positions, sound effects, all of these are on the same level of the hierarchy.  I'd love to have everything much more separate than this, so that mainmenu_selectioncursorx and characterselect_selectioncursorx are underneath their own respective classes(or structs).And on a side note, are most game engines typically contained within a single class/struct?Game States.  My main game loop at this point, consists of a series of IF statements determining whether or not a certain gamestate is active, and what state the game's user input is being applied to, and a drawscreen function that draws everything that's been processed.  I'm happy with how this works, as it allows me to be very flexible, and call up any state at any time after setting it up, my problem is that:I have one void function to initialize a stateI have one void function to run/process a stateI have one void function to get the input for a stateI have one void function to destroy a stateEvery single one of these functions, in the language I'm using, is a separate global function.Is there a way to do this exact same thing, but in a more uniform manner that will allow me to initialize, run, process input, and destroy a game state?Unexpectedly, those are the only major areas I'm unsure of how to convert.  I'm sure I will have more later, but these two would be a great help.  Thanks a lot in advance.   
Quote:Is there a way to do this exact same thing, but in a more uniform manner that will allow me to initialize, run, process input, and destroy a game state?Only have time for a short answer right now, but for the above, look into inheritance, polymorphism, and virtual functions (if you haven't already).   ;  Here's another one that's going to cause me to rack my brain.  My game, in its original form, has self-written scripting where it parses a line based on the spacing (" ") and checks each keyword/value left to right.  Is there a library that I most likely have on my computer that will do this same thing just as easily ("ParseString("THIS IS A STRING", 2) would return "IS", for example)?  Keep in mind, I already have this programmed, so if such a function (for some reason) demands a complete rewrite of my entire game, I'll pass.  If that doesn't work, then a solution that would be just as easy would be a C/C++ equiavelnt to BASIC's "MID$" function, since that keyword is the only reason I made this post.Thanks to the previous poster, by the way.   