PIV & Pedestrian Peril C# Game

C# and Teensy code after the video.

As part of adding value for one of our larger integration customers, Honda of North America, we would put on safety training events at the Honda plants peppered throughout Ohio.  The events consisted of various booths that would have games the associates could participate in to reinforce safety concepts and habits pertinent to an industrial manufacturing environment.

Our group would consult with Honda about what safety topics to focus on and we would come up with games and training scenarios that would be fun, educational, and challenging for the associates.  One such topic was personal industrial vehicle and pedestrian safety within the plants.

I was in charge of coming up with the graphics and posters for these events, but I wanted to challenge myself and come up with something that would take an upcoming event to the next level.  I got the thought in my head that a Jeopardy clone would be something fun for me to work on as well as fun for the associates attending the training event.

So I wrote a Jeopardy game in C#, molded to fit the 'flow' of the event in which groups of associates would visit each booth, participate in the game at the booth, and be awarded points - each group vying for the top score for extra prizes.

The game basically runs on a loop (with a secret reset button in case anything goes wrong), fed by a text files containing the question set (allowing for different question sets in the future) as well as text files for the categories and the point values for each question, while keeping track of what questions were answered incorrectly so that management could follow up on topics that might need further attention after the event.

For extra fun, my IT associate found a relay that could be triggered by wireless 'no-battery-required' buttons (by virtue of a charge being generated by the press of the button sending a signal to the relay) in order to control the game.  Each person in the group of four associates would get a button with a color that matched an answer choice on the screen of the game.  Attached to the relay was a Teensy 3.2 microcontroller that I programmed to act as an HID, accepting button presses from the relay and passing key presses to the game to answer the questions.

Originally the game was called 'Pedestrians in Jeopardy', but the local printers refused to print my original poster for the game over copyright fears.  So I was forced to redesign the poster (the title screen of the game) for the new, dry title lol

0:00
/
PIV & Pedestrian Peril in action.
/* 
  Buttons to USB Keyboard Example used as a starting point
  Also includes logic to blink the Teensy's onboard LED to indicated 
  a button press, for testing the wireless buttons and relay
*/

#include <Keyboard.h>
#include <Bounce.h>

int state; // 0 for default 'nothing' state 1 for A 2 for B 3 for C 4 for D
int prevState; // hold the last state for comparison
int ApinVal, BpinVal, CpinVal, DpinVal; // to hold pin readings
bool doUpdate; //true if the state has changed, false if the state is the same as the last check
bool doBlink;
long interval = 1000;
long previousMillis = 0;
int ledState = LOW;
int ledPin = 13;
int Apin = 0;
int Bpin = 1;
int Cpin = 2;
int Dpin = 3;
int bounceVal = 10;
Bounce aButton = Bounce(Apin,bounceVal);
Bounce bButton = Bounce(Bpin,bounceVal);
Bounce cButton = Bounce(Cpin,bounceVal);
Bounce dButton = Bounce(Dpin,bounceVal);

void setup() {
    pinMode(Apin, INPUT_PULLUP);
    pinMode(Bpin, INPUT_PULLUP);
    pinMode(Cpin, INPUT_PULLUP);
    pinMode(Dpin, INPUT_PULLUP);
    pinMode(ledPin,OUTPUT);
}

void loop() {
    readPins();
    updateState();
    doStateAction();
}


void readPins() {
  aButton.update();
  bButton.update();
  cButton.update();
  dButton.update();
}

void updateState() {

  if(aButton.risingEdge()) {
    state = 1;
    ledState = HIGH;
  } else if(bButton.risingEdge()) {
    state = 2;
    ledState = HIGH;
  } else if(cButton.risingEdge()) {
    state = 3;
    ledState = HIGH;
  } else if(dButton.risingEdge()) {
    state = 4;
    ledState = HIGH;
  } else {
    state = 0;
    ledState = LOW;
  }

  digitalWrite(ledPin, ledState);

  if(state != prevState) { //if the state has changed, then do a thing based on the state.
    doUpdate = true;
    doBlink = false;
  }
}


void doStateAction() {
  if(doUpdate) {
    switch(state) {
      case 0: {
        interval = 100;
        break;
      }   
      case 1: {
        Keyboard.print("a");  //send the letter 'a' to the game
        interval = 1000;
        break;
      }           
      case 2: {
        Keyboard.print("b");  //send the letter 'b' to the game
        interval = 1000;
        break;
      }
      case 3: {
        Keyboard.print("c");  //send the letter 'c' to the game
        interval = 1000;
        break;
      }
      case 4: {
        Keyboard.print("d");  //send the letter 'd' to the game
        interval = 1000;
        break;
      }
    }
    
    prevState = state;
    doUpdate = false; 
    doBlink = true;  
  }
}
TeensyHID.ino
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Drawing;

namespace PIJ 
/// PIJ because the game was originally called Pedestrians in Jeopardy
{

    public partial class MainWindow : Window
    {
        System.Drawing.Color pijBlue = ColorTranslator.FromHtml("#001fb2");
        String TitleImagePath = "/Resources/image/titleimage.png";

        public MainWindow()
        {
            InitializeComponent();
        }

        private void StartButton_Click(object sender, RoutedEventArgs e)
        {
            GameBoard theGameBoard = new GameBoard();

            System.Windows.Media.Animation.DoubleAnimation animFadeIn = new System.Windows.Media.Animation.DoubleAnimation();
            animFadeIn.From = 0;
            animFadeIn.To = 1;
            animFadeIn.Duration = new Duration(TimeSpan.FromSeconds(.4));

            theGameBoard.BeginAnimation(PIJQuestionWindow.OpacityProperty, animFadeIn);
            theGameBoard.Show();
        }
    }
}
MainWindow.xaml.cs
<Window x:Class="PIJ.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:PIJ"
        mc:Ignorable="d"
        Title="MainWindow" Height="1080" Width="1920" WindowStyle="None" WindowState="Maximized">

    <Window.Resources>
        <Style x:Key="startFont">
            <Setter Property="TextElement.FontFamily" Value="Resources/#Electrofied BoldItalic"/>
        </Style>
        <ControlTemplate x:Key="ButtonBaseControlTemplate1" TargetType="{x:Type ButtonBase}">
            <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="Button.IsDefaulted" Value="True">
                    <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                </Trigger>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" TargetName="border" Value="#FFBEE6FD"/>
                    <Setter Property="BorderBrush" TargetName="border" Value="#FF3C7FB1"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter Property="Background" TargetName="border" Value="#FFC4E5F6"/>
                    <Setter Property="BorderBrush" TargetName="border" Value="#FF2C628B"/>
                </Trigger>
                <Trigger Property="ToggleButton.IsChecked" Value="True">
                    <Setter Property="Background" TargetName="border" Value="#FFBCDDEE"/>
                    <Setter Property="BorderBrush" TargetName="border" Value="#FF245A83"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Background" TargetName="border" Value="#001FB2"/>
                    <Setter Property="BorderBrush" TargetName="border" Value="Black"/>
                    <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="#FF838383"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    </Window.Resources>



    <Grid Background="Black">
        <Grid x:Name="PicGrid">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <Image x:Name="TitleImage" Stretch="Uniform" Grid.Column="0" Grid.Row="0"/>
        </Grid>

        <Grid x:Name="ButtonGrid">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <Button x:Name="StartButton" Click="StartButton_Click" BorderBrush="Black" BorderThickness="3" Template="{DynamicResource ButtonBaseControlTemplate1}" Grid.ColumnSpan="5" Margin="0,0,0,0" Grid.RowSpan="7">
                <Image Source="/Resources/image/titleimagenew.png" Width="1920" />
            </Button>
        </Grid>
    </Grid>
</Window>
MainWindow.xaml
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Drawing;

namespace PIJ
{
    public partial class GameBoard : Window
    {
        System.Drawing.Color pijBlue = ColorTranslator.FromHtml("#001fb2");
        List<List<Question>> clues = new List<List<Question>>();
        public ScoreBoard theScore = new ScoreBoard();
        System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();

        // flag to determine if all the other question windows etc are closed.  0 means other windows are open, 1 means they are all closed.
        public int allWindowsClosedFlag = 1;

        // number of questions to be answered, when this reaches 0, the game can be over
        public int questionCounter;

        System.Windows.Threading.DispatcherTimer waitForQuestionsToBeOverTimer = new System.Windows.Threading.DispatcherTimer();

        public SoundBoard ThePlayer { get; set; }
        public PIJQuestionWindow ClueWindow { get; private set; }

        public GameBoard()
        {
            InitializeComponent();

            questionCounter = 9;

            MakeRandomClues();
            FillBoard();
            CreateTimer();
            CreateWindowWaitTimer();
            ThePlayer = new SoundBoard();
            ThePlayer.PlayTheSound("RoundStart");
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string nameOfSender = ((Button)sender).Name.ToString();
            int row = Grid.GetRow((Button)sender) - 2;
            int col = Grid.GetColumn((Button)sender);

            ClueWindow = null;

            // subtract one from the questionCounter variable
            questionCounter -= 1;

            Button theButton = (Button)sender;
            theButton.IsEnabled = false;

            Question theClue = new Question();
            theClue = clues[col][row];

            if (!theClue.IsPictureQuestion)
            {
                ClueWindow = new QuestionWindow(theClue, this)
                {
                    AllowsTransparency = true
                };
            }
            else
            {
                ClueWindow = new PictureQuestionWindow(theClue, this)
                {
                    AllowsTransparency = true
                };
            }

            System.Windows.Media.Animation.DoubleAnimation animFadeIn = new System.Windows.Media.Animation.DoubleAnimation();
            animFadeIn.From = 0;
            animFadeIn.To = 1;
            animFadeIn.Duration = new Duration(TimeSpan.FromSeconds(.4));

            // the next two lines clear the text of the button that has already been pressed.
            TextBlock theText = FindVisualChild<TextBlock>((Button)sender);
            theText.Text = System.String.Empty;

            ClueWindow.BeginAnimation(PIJQuestionWindow.OpacityProperty, animFadeIn);
            ClueWindow.Show();

            //Question Window is now open, so set to 0, indicating that all windows are not closed
            allWindowsClosedFlag = 0;

        }

        //options button to be implemented later
        private void Options_Click(object sender, RoutedEventArgs e)
        {
            var OptionsWindow = new Options(ClueWindow, this, theScore.Score);
            OptionsWindow.ShowDialog();
        }

        private void FillCat()
        {
            List<String> cat = FileReader.ReadTheFile(FileReader.pathToCategories);
            Category_0.Text = cat.ElementAt(0);
            Category_1.Text = cat.ElementAt(1);
            Category_2.Text = cat.ElementAt(2);
        }

        private void FillBoard()
        {
            List<String> board = FileReader.ReadTheFile(FileReader.pathToBoard);
            TB0_2.Text = board.ElementAt(0);
            TB1_2.Text = board.ElementAt(0);
            TB2_2.Text = board.ElementAt(0);

            TB0_3.Text = board.ElementAt(1);
            TB1_3.Text = board.ElementAt(1);
            TB2_3.Text = board.ElementAt(1);

            TB0_4.Text = board.ElementAt(2);
            TB1_4.Text = board.ElementAt(2);
            TB2_4.Text = board.ElementAt(2);

            Score.Text = string.Format("{0:0.00}", theScore.Score);
        }

        public void MakeClues()
        {
            clues = FileReader.MakeTheClues(FileReader.pathToClues);
        }

        public void MakeRandomClues()
        {
            List<Question> temp = QuestionSetMaker.ReadClueFileToTempArray(FileReader.pathToClues);

            clues = QuestionSetMaker.getCluesFromList(QuestionSetMaker.pickRandomCategories(QuestionSetMaker.categories, 3), temp);

            Category_0.Text = QuestionSetMaker.categories.ElementAt(0);
            Category_1.Text = QuestionSetMaker.categories.ElementAt(1);
            Category_2.Text = QuestionSetMaker.categories.ElementAt(2);
        }

        private static TextBlock FindVisualChild<TextBlock>(DependencyObject parent) where TextBlock : DependencyObject
        {
            for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++)
            {
                DependencyObject child = VisualTreeHelper.GetChild(parent, i);
                if (child != null && child is TextBlock)
                    return (TextBlock)child;
                else
                {
                    TextBlock childOfChild = FindVisualChild<TextBlock>(child);
                    if (childOfChild != null)
                        return childOfChild;
                }
            }
            return null;
        }

        public void CreateTimer()
        {
            dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
            dispatcherTimer.Interval = new TimeSpan(0, 0, 120);
            dispatcherTimer.Start();
        }

        public void CreateWindowWaitTimer()
        {
            waitForQuestionsToBeOverTimer.Tick += new EventHandler(waitForQuestionsToBeOverTimer_Tick);
            waitForQuestionsToBeOverTimer.Interval = new TimeSpan(0, 0, 1);
        }

        private void waitForQuestionsToBeOverTimer_Tick(object sender, EventArgs e)
        {
            System.Windows.Media.Animation.DoubleAnimation animFadeIn = new System.Windows.Media.Animation.DoubleAnimation();
            animFadeIn.From = 0;
            animFadeIn.To = 1;
            animFadeIn.Duration = new Duration(TimeSpan.FromSeconds(.4));

            waitForQuestionsToBeOverTimer.Stop();

            CheckWindowsClosedFlag(animFadeIn);
        }

        private void dispatcherTimer_Tick(object sender, EventArgs e)
        {
            System.Windows.Media.Animation.DoubleAnimation animFadeIn = new System.Windows.Media.Animation.DoubleAnimation();
            animFadeIn.From = 0;
            animFadeIn.To = 1;
            animFadeIn.Duration = new Duration(TimeSpan.FromSeconds(.4));

            dispatcherTimer.Stop();

            CheckWindowsClosedFlag(animFadeIn);
        }

        private void OpenGameOverWindow(System.Windows.Media.Animation.DoubleAnimation animFadeIn)
        {
            GameOver GameOverWindow = null;

            GameOverWindow = new GameOver(theScore.Score, this)
            {
                AllowsTransparency = true
            };

            GameOverWindow.BeginAnimation(GameOver.OpacityProperty, animFadeIn);
            GameOverWindow.Show();

        }

        private void CheckWindowsClosedFlag(System.Windows.Media.Animation.DoubleAnimation animFadeIn)
        {
            if (allWindowsClosedFlag == 1) // if all the other windows are closed
            {
                // open gameover window
                OpenGameOverWindow(animFadeIn);
            }
            else
            {
                // start wait timer and check again
                waitForQuestionsToBeOverTimer.Start();
            }
        }

        public void CloseTheGame()
        {
            System.Windows.Media.Animation.DoubleAnimation animFadeIn = new System.Windows.Media.Animation.DoubleAnimation();
            animFadeIn.From = 0;
            animFadeIn.To = 1;
            animFadeIn.Duration = new Duration(TimeSpan.FromSeconds(.4));

            // stop the game timer
            dispatcherTimer.Stop();

            // open gameover window
            OpenGameOverWindow(animFadeIn);
        }

        public void CloseTheGame(int fromOptions)
        {
            System.Windows.Media.Animation.DoubleAnimation animFadeIn = new System.Windows.Media.Animation.DoubleAnimation();
            animFadeIn.From = 0;
            animFadeIn.To = 1;
            animFadeIn.Duration = new Duration(TimeSpan.FromSeconds(.4));

            // stop the game timers
            dispatcherTimer.Stop();
            waitForQuestionsToBeOverTimer.Stop();

            // open gameover window
            OpenGameOverWindow(animFadeIn);
        }

        public void ResetTheGame()
        {
            // stop the game timers
            dispatcherTimer.Stop();
            waitForQuestionsToBeOverTimer.Stop();
        }
    }
}
GameBoard.xmal.cs
<Window x:Class="PIJ.GameBoard"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:PIJ"
        mc:Ignorable="d"
        Title="GameBoard" Height="1080" Width="1920" WindowStyle="None" WindowState="Maximized">

    <Window.Resources>
        <Style x:Key="catFont">
            <Setter Property="TextElement.FontFamily" Value="Resources/#Zurich"/>
        </Style>

        <ControlTemplate x:Key="ButtonBaseControlTemplate1" TargetType="{x:Type ButtonBase}">
            <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="Button.IsDefaulted" Value="True">
                    <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                </Trigger>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" TargetName="border" Value="#FFBEE6FD"/>
                    <Setter Property="BorderBrush" TargetName="border" Value="#FF3C7FB1"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter Property="Background" TargetName="border" Value="#FFC4E5F6"/>
                    <Setter Property="BorderBrush" TargetName="border" Value="#FF2C628B"/>
                </Trigger>
                <Trigger Property="ToggleButton.IsChecked" Value="True">
                    <Setter Property="Background" TargetName="border" Value="#FFBCDDEE"/>
                    <Setter Property="BorderBrush" TargetName="border" Value="#FF245A83"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Background" TargetName="border" Value="#001FB2"/>
                    <Setter Property="BorderBrush" TargetName="border" Value="Black"/>
                    <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="#FF838383"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    </Window.Resources>

    <Grid Background="Black">

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="15*" />
            <RowDefinition Height="1*" />
            <RowDefinition Height="15*" />
            <RowDefinition Height="15*" />
            <RowDefinition Height="15*" />
            <RowDefinition Height="9*" />
        </Grid.RowDefinitions>

        <Border Background="#001FB2" BorderBrush="Black" BorderThickness="3" Grid.Column="0" Grid.Row="0" Padding="10">
            <Border >
                <TextBlock x:Name="Category_0" Foreground="#ffffff" Style="{DynamicResource catFont}" FontSize="36" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" >
                    <TextBlock.Effect>
                        <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                    </TextBlock.Effect>
                </TextBlock>
            </Border>
        </Border>
        <Border Background="#001FB2" BorderBrush="Black" BorderThickness="3" Grid.Column="1" Grid.Row="0" Padding="10" >
            <Border >
                <TextBlock x:Name="Category_1" Foreground="#ffffff" Style="{DynamicResource catFont}" FontSize="36" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center">
                    <TextBlock.Effect>
                        <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                    </TextBlock.Effect>
                </TextBlock>
            </Border>
        </Border>
        <Border Background="#001FB2" BorderBrush="Black" BorderThickness="3" Grid.Column="2" Grid.Row="0" Padding="10">
            <Border >
                <TextBlock x:Name="Category_2" Foreground="#ffffff" Style="{DynamicResource catFont}" FontSize="36" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center">
                    <TextBlock.Effect>
                        <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                    </TextBlock.Effect>
                </TextBlock>
            </Border>
        </Border>

        <Button Click="Button_Click" x:Name="Button0_2" Grid.Column="0" Grid.Row="2" Background="#001FB2" BorderBrush="Black" BorderThickness="3" Template="{DynamicResource ButtonBaseControlTemplate1}" >
            <TextBlock x:Name="TB0_2" Foreground="#fdb913" Style="{DynamicResource catFont}" FontSize="65" FontWeight="UltraBlack" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" >
                <TextBlock.Effect>
                    <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                </TextBlock.Effect>
            </TextBlock>
        </Button>

        <Button Click="Button_Click" x:Name="Button1_2" Grid.Column="1" Grid.Row="2" Background="#001FB2" BorderBrush="Black" BorderThickness="3" Template="{DynamicResource ButtonBaseControlTemplate1}" >
            <TextBlock x:Name="TB1_2" Foreground="#fdb913" Style="{DynamicResource catFont}" FontSize="65" FontWeight="UltraBlack" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" >
                <TextBlock.Effect>
                    <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                </TextBlock.Effect>
            </TextBlock>
        </Button>
        <Button Click="Button_Click" x:Name="Button2_2" Grid.Column="2" Grid.Row="2" Background="#001FB2" BorderBrush="Black" BorderThickness="3" Template="{DynamicResource ButtonBaseControlTemplate1}" >
            <TextBlock x:Name="TB2_2" Foreground="#fdb913" Style="{DynamicResource catFont}" FontSize="65" FontWeight="UltraBlack" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" >
                <TextBlock.Effect>
                    <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                </TextBlock.Effect>
            </TextBlock>
        </Button>     

        <Button Click="Button_Click" x:Name="Button0_3" Grid.Column="0" Grid.Row="3" Background="#001FB2" BorderBrush="Black" BorderThickness="3" Template="{DynamicResource ButtonBaseControlTemplate1}" >
            <TextBlock x:Name="TB0_3" Foreground="#fdb913" Style="{DynamicResource catFont}" FontSize="65" FontWeight="UltraBlack" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" >
                <TextBlock.Effect>
                    <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                </TextBlock.Effect>
            </TextBlock>
        </Button>
        <Button Click="Button_Click" x:Name="Button1_3" Grid.Column="1" Grid.Row="3" Background="#001FB2" BorderBrush="Black" BorderThickness="3" Template="{DynamicResource ButtonBaseControlTemplate1}" >
            <TextBlock x:Name="TB1_3" Foreground="#fdb913" Style="{DynamicResource catFont}" FontSize="65" FontWeight="UltraBlack" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" >
                <TextBlock.Effect>
                    <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                </TextBlock.Effect>
            </TextBlock>
        </Button>
        <Button Click="Button_Click" x:Name="Button2_3" Grid.Column="2" Grid.Row="3" Background="#001FB2" BorderBrush="Black" BorderThickness="3" Template="{DynamicResource ButtonBaseControlTemplate1}" >
            <TextBlock x:Name="TB2_3" Foreground="#fdb913" Style="{DynamicResource catFont}" FontSize="65" FontWeight="UltraBlack" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" >
                <TextBlock.Effect>
                    <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                </TextBlock.Effect>
            </TextBlock>
        </Button>      

        <Button Click="Button_Click" x:Name="Button0_4" Grid.Column="0" Grid.Row="4" Background="#001FB2" BorderBrush="Black" BorderThickness="3" Template="{DynamicResource ButtonBaseControlTemplate1}" >
            <TextBlock x:Name="TB0_4" Foreground="#fdb913" Style="{DynamicResource catFont}" FontSize="65" FontWeight="UltraBlack" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" >
                <TextBlock.Effect>
                    <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                </TextBlock.Effect>
            </TextBlock>
        </Button>
        <Button Click="Button_Click" x:Name="Button1_4" Grid.Column="1" Grid.Row="4" Background="#001FB2" BorderBrush="Black" BorderThickness="3" Template="{DynamicResource ButtonBaseControlTemplate1}" >
            <TextBlock x:Name="TB1_4" Foreground="#fdb913" Style="{DynamicResource catFont}" FontSize="65" FontWeight="UltraBlack" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" >
                <TextBlock.Effect>
                    <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                </TextBlock.Effect>
            </TextBlock>
        </Button>
        <Button Click="Button_Click" x:Name="Button2_4" Grid.Column="2" Grid.Row="4" Background="#001FB2" BorderBrush="Black" BorderThickness="3" Template="{DynamicResource ButtonBaseControlTemplate1}" >
            <TextBlock x:Name="TB2_4" Foreground="#fdb913" Style="{DynamicResource catFont}" FontSize="65" FontWeight="UltraBlack" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" >
                <TextBlock.Effect>
                    <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                </TextBlock.Effect>
            </TextBlock>
        </Button>
        
        <Grid Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="1">

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="52*" />
                <ColumnDefinition Width="48*" />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <Border Grid.Column="0" Grid.Row="0">
                <TextBlock x:Name="TheWordScoreLol" Foreground="#ffffff" Style="{DynamicResource catFont}" FontSize="30" Text ="SCORE: " FontWeight="Medium" TextWrapping="Wrap" TextAlignment="Right" VerticalAlignment="Center">
                    <TextBlock.Effect>
                        <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                    </TextBlock.Effect>
                </TextBlock>
            </Border>

            <Border Grid.Column="1" Grid.Row="0">
                <TextBlock x:Name="Score" Foreground="#ffffff" Style="{DynamicResource catFont}" FontSize="50" FontWeight="UltraBlack" TextWrapping="Wrap" TextAlignment="Left" VerticalAlignment="Center">
                    <TextBlock.Effect>
                        <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                    </TextBlock.Effect>
                </TextBlock>
            </Border>
        </Grid>

        <Grid Grid.Column="3" Grid.Row="5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <Grid Grid.Column="1" Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <Button Click="Options_Click" x:Name="Options" Grid.Column="0" Grid.Row="1" Background="Black" BorderBrush="Black" BorderThickness="1" >
                    <TextBlock x:Name="OPTIONS" Foreground="#fdb913" Style="{DynamicResource catFont}" FontSize="40" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" >
                        <TextBlock.Effect>
                            <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                        </TextBlock.Effect>
                    </TextBlock>
                </Button>
            </Grid>
        </Grid>    
    </Grid>
</Window>
GameBoard.xaml
using System;
using System.Collections.Generic;
using System.Linq;
using System.Media;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace PIJ
{
    public partial class QuestionWindow : PIJQuestionWindow
    {
        public QuestionWindow(Question theClue, GameBoard theGameBoard)
        {
            InitializeComponent();
            TheClue = theClue;
            TheGameBoard = theGameBoard;
            SetUpAnimation();
            StartQuestionTimer();

            ClueText.Text = theClue.Clue;
            AnswerA.Text = theClue.A;
            AnswerB.Text = theClue.B;
            AnswerC.Text = theClue.C;
            AnswerD.Text = theClue.D;
        }
    }
}
QuestionWindow.xaml.cs
<local:PIJQuestionWindow x:Class="PIJ.QuestionWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:PIJ"
        mc:Ignorable="d"
        Title="QuestionWindow" Height="1080" Width="1920" WindowStyle="None" WindowState="Maximized" KeyDown="Window_KeyDown" Closing="Window_Closing">
    <Window.Resources>
        <Style x:Key="clueFont">
            <Setter Property="TextElement.FontFamily" Value="Resources/#enchanted"/>
        </Style>
    </Window.Resources>

    <Grid Background="#001FB2">

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="7*" />
            <RowDefinition Height="43*" />
            <RowDefinition Height="43*" />
            <RowDefinition Height="7*" />
        </Grid.RowDefinitions>

        <Border Grid.Column="0" Grid.Row="1">
            <TextBlock x:Name="ClueText" Foreground="#ffffff" Style="{DynamicResource clueFont}" FontSize="78" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Padding="80">
            <TextBlock.Effect>
                <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
            </TextBlock.Effect>
            </TextBlock>
        </Border>

        <Border Grid.Column="0" Grid.Row="2">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="2*" />
                    <ColumnDefinition Width="24*" />
                    <ColumnDefinition Width="24*" />
                    <ColumnDefinition Width="24*" />
                    <ColumnDefinition Width="24*" />
                    <ColumnDefinition Width="2*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="100*" />
                </Grid.RowDefinitions>

                <Border Grid.Column="1" Grid.Row="0" Background="#099177">
                    <TextBlock x:Name="AnswerA" Foreground="#ffffff" Style="{DynamicResource clueFont}" FontSize="44" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Padding="30">
                        <TextBlock.Effect>
                            <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                        </TextBlock.Effect>
                    </TextBlock>
                </Border>
                <Border Grid.Column="2" Grid.Row="0" Background="#2c65b0">
                    <TextBlock x:Name="AnswerB" Foreground="#ffffff" Style="{DynamicResource clueFont}" FontSize="44" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Padding="30">
                        <TextBlock.Effect>
                            <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                        </TextBlock.Effect>
                    </TextBlock>
                </Border>
                <Border Grid.Column="3" Grid.Row="0" Background="#ebcd24">
                    <TextBlock x:Name="AnswerC" Foreground="#ffffff" Style="{DynamicResource clueFont}" FontSize="44" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Padding="30">
                        <TextBlock.Effect>
                            <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                        </TextBlock.Effect>
                    </TextBlock>
                </Border>
                <Border Grid.Column="4" Grid.Row="0" Background="#d83a27">
                    <TextBlock x:Name="AnswerD" Foreground="#ffffff" Style="{DynamicResource clueFont}" FontSize="44" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Padding="30">
                        <TextBlock.Effect>
                            <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                        </TextBlock.Effect>
                    </TextBlock>
                </Border>

            </Grid>
        </Border>

    </Grid>
</local:PIJQuestionWindow>
QuestionWindow.xaml
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace PIJ
{
    public partial class PictureQuestionWindow : PIJQuestionWindow
    {
        public PictureQuestionWindow(Question theClue, GameBoard theGameBoard)
        {
            InitializeComponent();
            TheClue = theClue;
            TheGameBoard = theGameBoard;
            ClueImage.Source = new BitmapImage(new Uri(TheClue.PathToImage.ToString(), UriKind.Relative));
            //ClueImage.Source = new BitmapImage(new Uri(TheClue.PathToImage, UriKind.Relative));
            SetUpAnimation();
            StartQuestionTimer();
            ClueText.Text = theClue.Clue;
            AnswerA.Text = theClue.A;
            AnswerB.Text = theClue.B;
            AnswerC.Text = theClue.C;
            AnswerD.Text = theClue.D;
        }
    }
}
PictureQuestionWindow.xaml.cs
<local:PIJQuestionWindow x:Class="PIJ.PictureQuestionWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:PIJ"
        mc:Ignorable="d"
        Title="PictureQuestionWindow" Height="1080" Width="1920" WindowStyle="None" WindowState="Maximized" KeyDown="Window_KeyDown" Closing="Window_Closing">
    <Window.Resources>
        <Style x:Key="clueFont">
            <Setter Property="TextElement.FontFamily" Value="Resources/#enchanted"/>
        </Style>
    </Window.Resources>

    <Grid Background="#001FB2">

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="7*" />
            <RowDefinition Height="53*" />
            <RowDefinition Height="33*" />
            <RowDefinition Height="7*" />
        </Grid.RowDefinitions>

        <Border Grid.Column="0" Grid.Row="1">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="5*" />
                    <ColumnDefinition Width="61*" />
                    <ColumnDefinition Width="44*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <Border Grid.Column="1" Grid.Row="0">
                    <Image Name="ClueImage" Width="700" Height="500" Stretch="Uniform" />
                </Border>

                <Border Grid.Column="2" Grid.Row="0">
                    <TextBlock x:Name="ClueText" Foreground="#ffffff" Style="{DynamicResource clueFont}" FontSize="48" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Padding="50">
                        <TextBlock.Effect>
                            <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                        </TextBlock.Effect>
                    </TextBlock>                    
                </Border>
            </Grid>
        </Border>

        <Border Grid.Column="0" Grid.Row="2">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="2*" />
                    <ColumnDefinition Width="24*" />
                    <ColumnDefinition Width="24*" />
                    <ColumnDefinition Width="24*" />
                    <ColumnDefinition Width="24*" />
                    <ColumnDefinition Width="2*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="100*" />
                </Grid.RowDefinitions>

                <Border Grid.Column="1" Grid.Row="0" Background="#099177">
                    <TextBlock x:Name="AnswerA" Foreground="#ffffff" Style="{DynamicResource clueFont}" FontSize="48" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Padding="30">
                        <TextBlock.Effect>
                            <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                        </TextBlock.Effect>
                    </TextBlock>
                </Border>
                <Border Grid.Column="2" Grid.Row="0" Background="#2c65b0">
                    <TextBlock x:Name="AnswerB" Foreground="#ffffff" Style="{DynamicResource clueFont}" FontSize="48" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Padding="30">
                        <TextBlock.Effect>
                            <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                        </TextBlock.Effect>
                    </TextBlock>
                </Border>
                <Border Grid.Column="3" Grid.Row="0" Background="#ebcd24">
                    <TextBlock x:Name="AnswerC" Foreground="#ffffff" Style="{DynamicResource clueFont}" FontSize="48" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Padding="30">
                        <TextBlock.Effect>
                            <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                        </TextBlock.Effect>
                    </TextBlock>
                </Border>
                <Border Grid.Column="4" Grid.Row="0" Background="#d83a27">
                    <TextBlock x:Name="AnswerD" Foreground="#ffffff" Style="{DynamicResource clueFont}" FontSize="48" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Padding="30">
                        <TextBlock.Effect>
                            <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                        </TextBlock.Effect>
                    </TextBlock>
                </Border>
            </Grid>
        </Border>
    </Grid>
</local:PIJQuestionWindow>
PictureQuestionWindow.xaml
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PIJ
{
    public class Question
    {
        public Question()
        {
            Category = System.String.Empty;
            Clue = System.String.Empty;
            A = System.String.Empty;
            B = System.String.Empty;
            C = System.String.Empty;
            D = System.String.Empty;
            CorrectAnswer = System.String.Empty;
            Points = 0;
            IsPictureQuestion = false;
            PathToImage = System.String.Empty;
        }

        public string Category { get; set; }
        public string Clue { get; set; }
        public string A { get; set; }
        public string B { get; set; }
        public string C { get; set; }
        public string D { get; set; }
        public string CorrectAnswer { get; set; }
        public decimal Points { get; set; }
        public bool IsPictureQuestion { get; set; }
        public String PathToImage { get; set; }
    }
}
Question.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Threading;

namespace PIJ
{
    public partial class AnswerWindow : Window
    {
        System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
        PIJQuestionWindow CurrentQuestion;
        GameBoard TheGameBoard;

        public AnswerWindow(PictureQuestionWindow pictureQuestionWindow)
        {
            InitializeComponent();
            CreateTimer();
        }

        // constructor ought to accept both the regular question window and the picture question window
        public AnswerWindow(PIJQuestionWindow theCurrentQuestionWindow, GameBoard theGameBoard)
        {
            InitializeComponent();

            CurrentQuestion = theCurrentQuestionWindow;
            TheGameBoard = theGameBoard;

            CreateTimer();
        }

        public AnswerWindow(PictureQuestionWindow theCurrentQuestionWindow, GameBoard theGameBoard)
        {
            InitializeComponent();

            CurrentQuestion = theCurrentQuestionWindow;
            TheGameBoard = theGameBoard;

            CreateTimer();
        }

        private void dispatcherTimer_Tick(object sender, EventArgs e)
        {
            this.Close();
            CurrentQuestion.Close();
        }

        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            Closing -= Window_Closing;
            e.Cancel = true;

            System.Windows.Media.Animation.DoubleAnimation animFadeOut = new System.Windows.Media.Animation.DoubleAnimation();
            animFadeOut.From = 1;
            animFadeOut.To = 0;
            animFadeOut.Duration = new Duration(TimeSpan.FromSeconds(.5));
            animFadeOut.Completed += (s, _) => this.Close();

            this.BeginAnimation(UIElement.OpacityProperty, animFadeOut);
            dispatcherTimer.Stop();
            TheGameBoard.Score.Text = string.Format("{0:00.00}", TheGameBoard.theScore.Score);
            TheGameBoard.allWindowsClosedFlag = 1;

            if (TheGameBoard.questionCounter == 0)
            {
                TheGameBoard.CloseTheGame();
            }
        

        public void CreateTimer()
        {
            dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
            dispatcherTimer.Interval = new TimeSpan(0, 0, 5);
            dispatcherTimer.Start();
        }
    }
}
AnswerWindow.xaml.cs
<Window x:Class="PIJ.AnswerWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:PIJ"
        mc:Ignorable="d"
        Title="AnswerWindow" Height="1080" Width="1920" WindowStyle="None" Closing="Window_Closing" WindowState="Maximized">
    <Window.Resources>
        <Style x:Key="clueFont">
            <Setter Property="TextElement.FontFamily" Value="Resources/#enchanted"/>
        </Style>
    </Window.Resources>

    <Grid Background="#001FB2">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="10*" />
            <ColumnDefinition Width="80*" />
            <ColumnDefinition Width="10*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="10*" />
            <RowDefinition Height="30*" />
            <RowDefinition Height="50*" />
            <RowDefinition Height="10*" />
        </Grid.RowDefinitions>

        <Border Grid.Column="1" Grid.Row="1" Margin="0,10">
            <TextBlock x:Name="AnswerStatus" Foreground="#ffffff" Style="{DynamicResource clueFont}" FontSize="48" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Padding="10">
                <TextBlock.Effect>
                    <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                </TextBlock.Effect>
            </TextBlock>
        </Border>

        <Border Grid.Column="1" Grid.Row="2" Margin="0,10">
            <TextBlock x:Name="AnswerText" Foreground="#ffffff" Style="{DynamicResource clueFont}" FontSize="88" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" Padding="10">
                <TextBlock.Effect>
                    <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                </TextBlock.Effect>
            </TextBlock>
        </Border>

    </Grid>
</Window>
AnswerWindow.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PIJ
{
    public class ScoreBoard
    {
        public ScoreBoard()
        {
            Score = 0;
            Correct = 0;
            Incorrect = 0;
        }
        
        public decimal Score { get; set; }
        public int Correct { get; set; }
        public int Incorrect { get; set; }
    }
}
ScoreBoard.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Media;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using System.IO;
using System.Resources;
using System.Diagnostics;

namespace PIJ
{
    public class SoundBoard
    {
        SoundPlayer thePlayer = null;
        String thePath = System.String.Empty;

        public SoundBoard ()
        {
            thePlayer = new SoundPlayer();
        }

        // paths to the sounds
        public String BuzzIn = "Resources\\sound\\JeopardyBuzzin.wav";
        public String Correct = "Resources\\sound\\JeopardyCorrect.wav";
        public String DailyDouble = "Resources\\sound\\JeopardyDailyDouble.wav";
        public String FinalReveal = "Resources\\sound\\JeopardyFinalCategoryReveal.wav";
        public String NoAnswer = "Resources\\sound\\JeopardyNoAnswer.wav";
        public String RoundTimeOver = "Resources\\sound\\JeopardyRoundOutOfTime.wav";
        public String RoundStart = "Resources\\sound\\JeopardyStartOfRound.wav";
        public String WrongAnswer = "Resources\\sound\\JeopardyWrongAnswer.wav";

        public void PlayTheSound(String type)
        {
            switch (type)
            {
                case "BuzzIn":
                    thePath = BuzzIn;
                    break;
                case "Correct":
                    thePath = Correct;
                    break;
                case "DailyDouble":
                    thePath = DailyDouble ;
                    break;
                case "FinalReveal":
                    thePath = FinalReveal;
                    break;
                case "NoAnswer":
                    thePath = NoAnswer;
                    break;
                case "RoundTimeOver":
                    thePath = RoundTimeOver;
                    break;
                case "RoundStart":
                    thePath = RoundStart;
                    break;
                case "WrongAnswer":
                    thePath = WrongAnswer;
                    break;
            }
        
            thePlayer.SoundLocation = thePath;
            thePlayer.Load();
            thePlayer.Play();
        }
    }
}
SoundBoard.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Threading;

namespace PIJ
{
    public partial class GameOver : Window
    {
        public SoundBoard ThePlayer { get; set; }
        public GameBoard TheGameBoard { get; set; }

        public DoubleAnimation animFadeIn { get; set; }

        public decimal TheScore { get; set; }

        System.Windows.Threading.DispatcherTimer windowCloseTimer = new System.Windows.Threading.DispatcherTimer();
        System.Windows.Threading.DispatcherTimer gameBoardCloseTimer = new System.Windows.Threading.DispatcherTimer();

        public GameOver(decimal score, GameBoard theGameBoard)
        {
            InitializeComponent();
            CreateTimer();

            this.AllowsTransparency = true;

            ThePlayer = new SoundBoard();
            TheScore = score;
            TheGameBoard = theGameBoard;

            DoScoreStuff();
            ThePlayer.PlayTheSound("RoundTimeOver");
        }

        private void DoScoreStuff()
        {
            FinalScore.Text = string.Format("{0:0.00}", TheScore);
            FileWriter.ScoreWriteToFile(TheScore.ToString(), DateTime.Now.ToString());
        }

        private void WindowCloseTimer_Tick(object sender, EventArgs e)
        {
            System.Windows.Media.Animation.DoubleAnimation animFadeOut = new System.Windows.Media.Animation.DoubleAnimation();
            animFadeOut.From = 1;
            animFadeOut.To = 0;
            animFadeOut.Duration = new Duration(TimeSpan.FromSeconds(.5));
            animFadeOut.Completed += (s, _) => this.Close();

            this.BeginAnimation(UIElement.OpacityProperty, animFadeOut);
            windowCloseTimer.Stop();
        }

        protected void GameBoardCloseTimer_Tick(object sender, EventArgs e)
        {
            TheGameBoard.Close();
            gameBoardCloseTimer.Stop();
        }

        public void CreateTimer()
        {
            gameBoardCloseTimer.Tick += new EventHandler(GameBoardCloseTimer_Tick);
            gameBoardCloseTimer.Interval = new TimeSpan(0, 0, 1);
            gameBoardCloseTimer.Start();

            windowCloseTimer.Tick += new EventHandler(WindowCloseTimer_Tick);
            windowCloseTimer.Interval = new TimeSpan(0, 0, 12);
            windowCloseTimer.Start();
        }
    }
}
GameOver.xaml.cs
<Window x:Class="PIJ.GameOver"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:PIJ"
        mc:Ignorable="d"
        Title="GameOver" Height="1080" Width="1920" WindowStyle="None" WindowState="Maximized">

    <Window.Resources>
        <Style x:Key="catFont">
            <Setter Property="TextElement.FontFamily" Value="Resources/#Zurich"/>
        </Style>
    </Window.Resources>
    <Grid x:Name="GameOverGrid" Background="#001FB2">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Border Background="#ffd500" BorderBrush="Black" BorderThickness="3" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="4" Grid.RowSpan="4">
            <Grid x:Name="ScoreGrid">

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="20*" />
                    <RowDefinition Height="70*" />
                    <RowDefinition Height="10*" />
                </Grid.RowDefinitions>

                <TextBlock x:Name="ScoreTitle" Foreground="#001FB2" Grid.Row="0" Style="{DynamicResource catFont}" FontSize="46" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Text="Game Over!  Your Team Scored:">
                </TextBlock>

                <TextBlock x:Name="FinalScore" Foreground="#001FB2" Grid.Row="1" Style="{DynamicResource catFont}" FontSize="440" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" >
                </TextBlock>

                <TextBlock x:Name="Points" Foreground="#001FB2" Grid.Row="1" Style="{DynamicResource catFont}" FontSize="46" FontWeight="Bold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Text="Points" Height="103" Margin="0,322,0,-1" Grid.RowSpan="2">

                </TextBlock>
            </Grid>
        </Border >
    </Grid>
</Window>
GameOver.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace PIJ
{
    public partial class Options : Window
    {
        PIJQuestionWindow CurrentQuestion;
        GameBoard TheGameBoard;

        public decimal TheScore { get; set; }

        public Options(PIJQuestionWindow theCurrentQuestionWindow, GameBoard theGameBoard, decimal score)
        {
            InitializeComponent();

            TheScore = score;
            CurrentQuestion = theCurrentQuestionWindow;
            TheGameBoard = theGameBoard;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            PIJMessageBox message = new PIJMessageBox();
            bool? result = message.ShowDialog();

            if (result ?? true) {
                FileWriter.ResetWriteToFile(TheScore.ToString(), DateTime.Now.ToString());
                TheGameBoard.ResetTheGame();
                TheGameBoard.Close();
                this.Close();
            }
            else {
                this.Close();
            }            
        }

        private void Cancel_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}
Optons.xaml.cs
<Window x:Class="PIJ.Options"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:PIJ"
        mc:Ignorable="d"
        Title="Game Reset" Height="440" Width="700" WindowStartupLocation="CenterScreen" WindowStyle="None" WindowState="Normal">

    <Window.Resources>
        <Style x:Key="startFont">
            <Setter Property="TextElement.FontFamily" Value="Resources/#Electrofied BoldItalic"/>
        </Style>
    </Window.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="70*" />
            <RowDefinition Height="30*" />
        </Grid.RowDefinitions>

        <Button HorizontalAlignment="Left" Height="302" VerticalAlignment="Top" Width="690" Click="Button_Click" Background="#001FB2" BorderBrush="Black" BorderThickness="3" Grid.Column="0" Grid.Row="0">
            <TextBlock Text="Reset Game" x:Name="ResetText" Foreground="#fdb913" Style="{DynamicResource startFont}" FontSize="85" FontWeight="UltraBlack" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Width="640" >
                <TextBlock.Effect>
                    <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                </TextBlock.Effect>
            </TextBlock>
        </Button>

        <Button HorizontalAlignment="Left" Height="130" VerticalAlignment="Top" Width="690" Click="Cancel_Click" Background="#001FB2" BorderBrush="Black" BorderThickness="3" Grid.Column="0" Grid.Row="1">
            <TextBlock Text="Cancel" x:Name="CancelText" Foreground="#fdb913" Style="{DynamicResource startFont}" FontSize="55" FontWeight="UltraBlack" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Width="640" >
                <TextBlock.Effect>
                    <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                </TextBlock.Effect>
            </TextBlock>
        </Button>
    </Grid>
</Window>
Options.xaml
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace PIJ
{
    public partial class PIJMessageBox : Window
    {
        public PIJMessageBox()
        {
            InitializeComponent();
        }

        private void OK_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
        }

        private void Cancel_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
    }
}
MessageBox.xaml.cs
<Window x:Class="PIJ.PIJMessageBox"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:PIJ"
        mc:Ignorable="d"
        Title="PIJMessageBox" Height="167.451" Width="472" WindowStartupLocation="CenterScreen" WindowStyle="None">

    <Window.Resources>
        <Style x:Key="startFont">
            <Setter Property="TextElement.FontFamily" Value="Resources/#Electrofied BoldItalic"/>
        </Style>
        <Style x:Key="catFont">
            <Setter Property="TextElement.FontFamily" Value="Resources/#Zurich"/>
        </Style>
    </Window.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50*" />
            <ColumnDefinition Width="50*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="25*" />
            <RowDefinition Height="75*" />
        </Grid.RowDefinitions>

        <TextBlock Text="Are you sure you want to reset the game?" x:Name="MessageBoxText" Foreground="#001FB2" Style="{DynamicResource catFont}" FontSize="20" FontWeight="UltraBlack" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Grid.ColumnSpan="2" Margin="10,9,10,7" />

        <Button HorizontalAlignment="Left" x:Name="OKButton" Height="107" VerticalAlignment="Top" Width="212" Click="OK_Click" Background="#001FB2" BorderBrush="Black" BorderThickness="3" Grid.Column="0" Grid.Row="1" Margin="10,0,0,0">
            <TextBlock Text="OK" x:Name="OKText" Foreground="#fdb913" Style="{DynamicResource catFont}" FontSize="35" FontWeight="UltraBlack" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Width="200" Height="38" >
                <TextBlock.Effect>
                    <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                </TextBlock.Effect>
            </TextBlock>
        </Button>

        <Button HorizontalAlignment="Left" x:Name="CancelButton" Height="107" VerticalAlignment="Top" Width="212" Click="Cancel_Click" Background="#001FB2" BorderBrush="Black" BorderThickness="3" Grid.Column="1" Grid.Row="1" Margin="10,0,0,0">
            <TextBlock Text="Cancel" x:Name="CancelText" Foreground="#fdb913" Style="{DynamicResource catFont}" FontSize="35" FontWeight="UltraBlack" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Width="200" Height="38" >
                <TextBlock.Effect>
                    <DropShadowEffect ShadowDepth="4" RenderingBias="Performance"/>
                </TextBlock.Effect>
            </TextBlock>
        </Button>
    </Grid>
</Window>
MessageBox.xaml
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PIJ
{
    public class FileReader
    {
        List<String> categories = new List<String>();
        List<String> questions = new List<String>();
        List<String> answers = new List<String>();
        List<String> boardSquares = new List<String>();

        public static string dir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

        public static String pathToCategories = dir + @"\text\pij_cat.txt";
        public static String pathToClues = dir + @"\text\pij_clues.txt";
        public static String pathToBoard = dir + @"\text\pij_board.txt";

        // method to read the text files and add the stuff to a list
        public static List<String> ReadTheFile(String thePath)
        {
            List<String> data = new List<String>();
            using (StreamReader theFile = new StreamReader(thePath))
            {
                while (theFile.Peek() >= 0)
                {
                    data.Add(theFile.ReadLine());
                }
            }
            return data;
        }

        // old
        public static List<List<Question>> MakeTheClues (String thePath)
        {
            List<List<Question>> clueSet = new List<List<Question>>();
            int i;
            int j;
            int points= 0;
            int twoHundred = 200;

            using (StreamReader theFile = new StreamReader(thePath))
            {
                //string line;
                //while ((line = theFile.ReadLine()) != null)
                    while (theFile.Peek() >= 0)
                {
                    // create the clue set, six columns of 5 clues
                    for (i = 0; i < 6; i++)
                    {
                        points = twoHundred;
                        List<Question> row = new List<Question>();
                        // create a row of clues
                        for (j = 0; j < 5; j++)
                        {
                            // do the actual populating of the Question object
                            Question aClue = new Question();
                            aClue.Clue = theFile.ReadLine();
                            aClue.A = theFile.ReadLine();
                            aClue.B = theFile.ReadLine();
                            aClue.C = theFile.ReadLine();
                            aClue.D = theFile.ReadLine();
                            aClue.CorrectAnswer = theFile.ReadLine();
                            aClue.Points = points;

                            //check for the bool
                            String boolString = theFile.ReadLine();

                            if (boolString == "0")
                            {
                                aClue.IsPictureQuestion = false;
                            }
                            if (boolString == "1")
                            {
                                aClue.IsPictureQuestion = true;
                            }

                            aClue.PathToImage = theFile.ReadLine();

                            row.Add(aClue);
                            points += twoHundred;
                        }
                        clueSet.Add(row);
                    }
                }
            }
                return clueSet;
        }
    }    
}
FileReader.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PIJ
{
    public static class FileWriter
    {
        public static string dir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

        private static String PathToWrongAnswerFile = dir + @"\text\pij_wronganswers.txt";
        private static String PathToCorrectAnswerFile = dir + @"\text\pij_correctanswers.txt";
        private static String PathToScore = dir + @"\text\pij_scores.txt";
        private static String PathToReset = dir + @"\text\pij_resets.txt";


        public static void WrongAnswerWriteToFile(String theClue, String thePlayerAnswer, string time)
        {
            System.IO.StreamWriter writer;
            writer = new System.IO.StreamWriter(PathToWrongAnswerFile, true);

            writer.WriteAsync(time + ";");
            writer.WriteAsync(theClue + ";");
            writer.WriteAsync(thePlayerAnswer + ";");
            writer.WriteLineAsync("");
            writer.Close();
        }

        public static void CorrectAnswerWriteToFile(String theClue,String thePlayerAnswer, string time)
        {
            System.IO.StreamWriter writer;
            writer = new System.IO.StreamWriter(PathToCorrectAnswerFile, true);
            
            writer.WriteAsync(time + ";");
            writer.WriteAsync(theClue + ";");
            writer.WriteAsync(thePlayerAnswer + ";");
            writer.WriteLineAsync("");
            writer.Close();
        }

        public static void ScoreWriteToFile(String theScore, string time)
        {
            System.IO.StreamWriter writer;
            writer = new System.IO.StreamWriter(PathToScore, true);

            writer.WriteAsync(time + ";");
            writer.WriteAsync(theScore + ";");
            writer.WriteLineAsync("");
            writer.Close();
        }

        public static void ResetWriteToFile(String theScore, string time)
        {
            System.IO.StreamWriter writer;
            writer = new System.IO.StreamWriter(PathToReset, true);
            writer.WriteAsync("Reset;");
            writer.WriteAsync(time + ";");
            writer.WriteAsync(theScore + ";");
            writer.WriteLineAsync("");
            writer.Close();
        }
    }
}
FileWriter.cs

Sheesh that's a ton of code for a silly little Jeopardy clone.