public NormalGameplay(Game game, PlayerIndex player, Dictionary<char, Letter> alphabet, GridRenderer renderer, ILetterSet letterSet) : base(game) { //this.player = player; this.game = (Shorewood)game; this.alphabet = alphabet; this.gridRenderer = renderer; this.letterSet = letterSet; this.Enabled = false; this.onA = new EventHandler<ButtonFireEventArgs>(OnA); this.onLeft = new EventHandler<ButtonFireEventArgs>(OnLeft); this.onRight = new EventHandler<ButtonFireEventArgs>(OnRight); this.onTrigger = new EventHandler<ButtonFireEventArgs>(OnTrigger); AddEvents(); }
public NormalGameplayDebugger(Game game, PlayerIndex player, Dictionary<char,Letter> alphabet,GridRenderer renderer,ILetterSet letterSet ) : base(game, player, alphabet, renderer, letterSet) { }
void Load() { //shader1337 = new _1337Shader(this); normalGameplayRenderer = new GridScreenRenderer(this); recentWords = new RecentWordsRenderer(this, 5); letterSet = new ScrabbleSet(); goalRenderer = new GoalRenderer(this); gameplayTimer = new TimerComponent(this); timerRenderer = new TimerRenderer(this); freeSpellMode = new FreeSpellMode(this); creditsBackground = new CreditsBackground(this); creditsForeground = new CreditsForeground(this); Grid grid = new Grid(alphabet); letterSet.Alphabet = alphabet; Shorewood.wordDatabase = Content.Load<SuffixTree>("Words\\2of4brif"); grid.wordDatabase = Shorewood.wordDatabase; grid.letterSet = letterSet; float gridActualWidth = 450;//(grid.width * alphabet['z'].texture.Width + alphabet['z'].texture.Width / 2) * scale; float gridActualHeight = (grid.height * alphabet['z'].texture.Height * 2 / 3) * scale; normalGameplayRenderer.grid = grid; normalModeGamePlay = new NormalGameplay(this, PlayerIndex.One, alphabet, normalGameplayRenderer, letterSet); gameplayTimer.AddEvent(new TimeSpan(), new OnTime(normalModeGamePlay.GameOver)); normalModeGamePlay.wordAnimationRenderer = foundWordAnimator; normalGameplayRenderer.Enabled = false; foundWordAnimator.scale = scale; foundWordAnimator.destination = new Vector2(titleSafeArea.X + 20, titleSafeArea.Y + 60); foundWordAnimator.destinationScale = 0.5f; foundWordAnimator.recentWords = recentWords; normalGameplayRenderer.foundWordAnimator = foundWordAnimator; normalGameplayRenderer.scale = scale; normalGameplayRenderer.position = new Vector2(titleSafeArea.Width / 2 - gridActualWidth / 2 + titleSafeArea.X, titleSafeArea.Y); normalGameplayRenderer.Visible = false; goalRenderer.position = new Vector2(normalGameplayRenderer.position.X + gridActualWidth + 10, titleSafeArea.Y + 20); foundWordAnimator.startPositionOffset = normalGameplayRenderer.position; recentWords.position = foundWordAnimator.destination; recentWords.startOffsetPosition = foundWordAnimator.startPositionOffset; recentWords.scale = scale; normalModeGamePlay.Enabled = false; isLoaded = true; Components.Add(constantBackground); Components.Add(normalModeGamePlay); Components.Add(normalGameplayRenderer); Components.Add(goalRenderer); Components.Add(recentWords); Components.Add(scoreBox); Components.Add(foundWordAnimator); Components.Add(timerRenderer); Components.Add(freeSpellMode); bloom.Settings = BloomSettings.PresetSettings[(int)BloomType.Blurry]; Components.Add(bloom); Components.Add(creditsBackground); Components.Add(particleSystem); Components.Add(creditsForeground); Components.Add(menu); Components.Add(dialogManager); Components.Add(popUpManager); Components.Add(storageScreen); Components.Add(gameplayTimer); bloom.Enabled = false; bloom.Visible = false; levelManager = new NormalGameplayLevelManager(); normalModeGamePlay.levelManager = levelManager; goalRenderer.levelManager = levelManager; GC.Collect(); soundTrack.Start(); }