143 lines
		
	
	
		
			5.6 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
			
		
		
	
	
			143 lines
		
	
	
		
			5.6 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
<Window x:Class="TetrisRPS.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:TetrisRPS"
 | 
						|
        mc:Ignorable="d"
 | 
						|
        Title="Dual-Tetris" Height="600" Width="900" 
 | 
						|
        MinWidth="900" MinHeight="600"
 | 
						|
        Foreground="White" FontWeight="Bold" FontFamily="Segoe UI" FontSize="25"
 | 
						|
        Icon="assets/icon.png" KeyDown="WindowKeyDown">
 | 
						|
    <!--Add the Function for detecing player input-->
 | 
						|
    <!--Key down event handler-->
 | 
						|
    <!--KeyDown="Name of the function for detection"-->
 | 
						|
    <Grid>
 | 
						|
        <Grid.RowDefinitions>
 | 
						|
            <RowDefinition Height="auto"/>
 | 
						|
            <RowDefinition Height="auto"/>
 | 
						|
            <RowDefinition Height="*"/>
 | 
						|
        </Grid.RowDefinitions>
 | 
						|
 | 
						|
        <Grid.ColumnDefinitions>
 | 
						|
            <ColumnDefinition Width="*"/>
 | 
						|
            <ColumnDefinition Width="auto"/>
 | 
						|
            <ColumnDefinition Width="50"/>
 | 
						|
            <ColumnDefinition Width="auto"/>
 | 
						|
            <ColumnDefinition Width="*"/>
 | 
						|
        </Grid.ColumnDefinitions>
 | 
						|
 | 
						|
        <Grid.Background>
 | 
						|
            <ImageBrush ImageSource="assets\background.jpg"/>
 | 
						|
        </Grid.Background>
 | 
						|
 | 
						|
        <!--For entering the IP address-->
 | 
						|
        <TextBlock Grid.Row="0" Grid.Column="1"
 | 
						|
                   VerticalAlignment="Top" HorizontalAlignment="Center"
 | 
						|
                   Text="Enter IP address:"
 | 
						|
                   FontSize="20" Margin="0,5,0,50"/>
 | 
						|
        
 | 
						|
        <TextBox Grid.Row="0" Grid.Column="1" 
 | 
						|
                 VerticalAlignment="Center" HorizontalAlignment="Center"
 | 
						|
                 TextWrapping="Wrap" Width="175" Height="25" FontSize="15"
 | 
						|
                 FontWeight="Light" Margin="0,15,0,0"
 | 
						|
                 Name="IPInput"/>
 | 
						|
        
 | 
						|
        <Button Grid.Row="0" Grid.Column="1"
 | 
						|
                VerticalAlignment="Bottom" HorizontalContentAlignment="Center"
 | 
						|
                Content="Start" Width="75" Height="18" FontWeight="Light" FontSize="10"
 | 
						|
                Click="Star_Click"
 | 
						|
                Name="StartButton"
 | 
						|
                />
 | 
						|
 | 
						|
        <!--For choosing to either be a host or not-->
 | 
						|
        <TextBlock Grid.Row="0" Grid.Column="3"
 | 
						|
                   VerticalAlignment="Top" HorizontalAlignment="Center"
 | 
						|
                   Margin="0,10,0,0"
 | 
						|
                   Text="SinglePlayer:" FontWeight="Bold" FontSize="20"/>
 | 
						|
        <CheckBox Grid.Row="0" Grid.Column="3" Margin="0,5,0,0"
 | 
						|
                  VerticalAlignment="Center" HorizontalAlignment="Center"
 | 
						|
                  Name="IsSinglePlayer"
 | 
						|
                  />
 | 
						|
 | 
						|
        <!--Current players game view-->
 | 
						|
        <Viewbox Grid.Row="2" Grid.Column="1" Margin="0,15,0,15">
 | 
						|
 | 
						|
            <!--Add the Function for loading the game into the Loaded argument-->
 | 
						|
            <!--The loading argument goes inside the Canvas-->
 | 
						|
            <!--Loaded="Function Name For Loading"-->
 | 
						|
            <Canvas x:Name="firstCanvas"
 | 
						|
                Grid.Row="1"
 | 
						|
                Grid.Column="1"
 | 
						|
                Width="250"
 | 
						|
                Height="500"
 | 
						|
                ClipToBounds="True"
 | 
						|
                Background="#545454"/>
 | 
						|
        </Viewbox>
 | 
						|
 | 
						|
        <!--The block that is currently being held-->
 | 
						|
        <StackPanel Grid.Row="2"
 | 
						|
                    Grid.Column="0"
 | 
						|
                    VerticalAlignment="Top"
 | 
						|
                    HorizontalAlignment="Right">
 | 
						|
            <TextBlock Text="Hold" TextAlignment="Center"/>
 | 
						|
 | 
						|
            <Image x:Name="holdImage" Margin="20" Width="120"/>
 | 
						|
        </StackPanel>
 | 
						|
 | 
						|
        <!--The game view of the opposing player-->
 | 
						|
        <Viewbox Grid.Row="2" Grid.Column="3" Margin="0,15,0,15">
 | 
						|
 | 
						|
            <!--Add the Function for loading the game into the Loaded argument-->
 | 
						|
            <!--The loading argument goes inside the Canvas-->
 | 
						|
            <!--Loaded="Function Name For Loading"-->
 | 
						|
            <Canvas x:Name="secondCanvas"
 | 
						|
                Grid.Row="1"
 | 
						|
                Grid.Column="1"
 | 
						|
                Width="250"
 | 
						|
                Height="500"
 | 
						|
                ClipToBounds="True"
 | 
						|
                Background="#545454"/>
 | 
						|
        </Viewbox>
 | 
						|
 | 
						|
        <!--The opponet of the player-->
 | 
						|
        <!--Dynamically change the text to either player 1 or 2-->
 | 
						|
        <TextBlock x:Name="againstPlayer"
 | 
						|
                   Grid.Row="1"
 | 
						|
                   Grid.Column="3"
 | 
						|
                   Text="Opponent"
 | 
						|
                   TextAlignment="Center"
 | 
						|
                   VerticalAlignment="Center"/>
 | 
						|
 | 
						|
        <!--Text in the middle "VS"-->
 | 
						|
        <TextBlock Grid.Row="2" Grid.Column="2" TextAlignment="Center" VerticalAlignment="Center" Text="VS"/>
 | 
						|
 | 
						|
        <StackPanel Grid.Row="1" Grid.Column="4">
 | 
						|
        </StackPanel>
 | 
						|
        
 | 
						|
        <!--This is the overlay for when the game is over-->
 | 
						|
        <!--Change the visibility to "Visible" once the game is over-->
 | 
						|
        <Grid x:Name="gameOverScreen"
 | 
						|
              Background="#CC000000"
 | 
						|
              Grid.RowSpan="3"
 | 
						|
              Grid.ColumnSpan="5" Visibility="Hidden">
 | 
						|
 | 
						|
            <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
 | 
						|
                
 | 
						|
                <!--This is the winning players textBlock change it based on the winner-->
 | 
						|
                <TextBlock x:Name="playerWinText" FontSize="48" TextAlignment="Center"/>
 | 
						|
 | 
						|
                <!--Play again button-->
 | 
						|
                <!--You can add the Click event/argument to reset the game-->
 | 
						|
                <Button Content="Play Again"
 | 
						|
                    Background="LightCyan"
 | 
						|
                    Margin="0, 20, 0, 0"
 | 
						|
                    Padding="5"
 | 
						|
                    Click="End_Click"
 | 
						|
                    />
 | 
						|
            </StackPanel>
 | 
						|
        </Grid>
 | 
						|
 | 
						|
    </Grid>
 | 
						|
</Window>
 |