public MockGameModel(GameConfiguration configuration, Level level) { _configuration = configuration; _level = level; _currentSequenceIndex = -1; _baseScore = 0; _currentSequenceCharIndex = -1; }
public GameModel(GameConfiguration configuration, Level level) { _configuration = configuration; _level = level; _baseScoreRunningTotal = 0; _speedBonusRunningTotal = 0; _chainBonusRunningTotal = 0; _currentChainScore = 0; _currentChainLength = 0; _currentSequenceSpeedBonus = 0; }
private void LoadLevels() { // Find and read in the level files this.levelFiles = Directory.GetFiles(LevelFolderPath, LevelFilePattern, SearchOption.TopDirectoryOnly); this.levelNames = new List<string>(); foreach(string levelFile in levelFiles) { Level level = new Level(levelFile); this.levelNames.Add(level.Name); } // Display the levels this.levelSelectionView.DisplayLevels(this.levelNames); }
public GameController(GameConfiguration configuration, Level level) : base() { //intiliazing model this.configuration = configuration; this.level = level; this.model = new GameModel(configuration, level); //attaching input hooks keyboardHook.KeyPress += new KeyPressEventHandler(keyboardHook_KeyPress); keyboardHook.KeyUp += new KeyEventHandler(keyboardHook_KeyUp); this.talkingWindow.Load += new System.EventHandler(this.TalkingWindow_Load); this.talkingWindow.Shown += new System.EventHandler(this.TalkingWindow_Shown); this.inputDrainTimer = new System.Threading.Timer(inputDrainCallback, null, TimeSpan.FromMilliseconds(-1), TimeSpan.FromMilliseconds(-1)); }
private void RunGame(Object data) { string levelFilename = (string)data; Level level = new Level(levelFilename); GameConfiguration config = GameConfigReader.GetGameConfig(@".\KeyboardGame.exe"); GameController controller = new GameController(config, level); controller.Run(); }