Game description:
A quiz with different levels and different types of visual questions for each level.
OOP so far: GameBoard (where one answers questions), Dialog, HighScore, Controller/LevelController?
I have a document class called Controller which initializes the game:
public function Controller()
{
initGame();
}
function initGame()
{
xmlGameData = levels, questions xml
highscore:HighScore = new HighScore();
startGame();
}
function startGame()
{
levelController = new LevelController( this, xmlGameData );
}
Then I'm starting to pass around a reference to the "Document class / main timeline" to my different object which in themselves extends MovieClip or Sprite.
public function LevelController(docClass, xml)
{
mainTimeLine = docClass;
xmlGameData = xml;
loadGameBoard();
nextLevel();
}
function loadGameBoard()
{
gameBoard = new GameBoard(mainTimeLine, this);
mainTimeLine.addChild(gameBoard);
}
This gets pretty messy after some time and I'd like to know better ways of controlling the different objects (like GameBoard and HighScore) and states (Levels) and actions (AnswerQuestion, NextQuestion etc.) from, maybe, a single point of control.