Does anyone have a basic framework or theory, on where a game should start programitically.

Like, how you handle the states (menu, pause, level 1, level 2 blah blah), how you work timing out? (for example if I drawn an intro with some animation and at a certain point during this intro, you want to change an animation and make it start moving around like a jump or something).

Just things like that, iv'e never been able to make a nice clean and solid beginning and the one I have right now is mostly for experimentation and messing around as it's very messy .