Skip to content

Commit

Permalink
2048 v0,2
Browse files Browse the repository at this point in the history
bugs report:
не нажимать быстро клавиши?
  • Loading branch information
AsTeFu committed Dec 16, 2018
1 parent cae443e commit 00a7388
Show file tree
Hide file tree
Showing 3 changed files with 490 additions and 68 deletions.
63 changes: 31 additions & 32 deletions 2048 wpf/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,44 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="608.585" Width="495.029">
Title="2048" Height="700" Width="508" Background="#faf8ef">


<Canvas Height="400" Width="400" KeyDown="InputPlayer" Name="mainCanvas">
<Rectangle Fill="Gray" Width="400" Height="400" RadiusX="5" RadiusY="5"/>

<Grid Name="gameField" Height="390" Width="390" Margin="5">
<StackPanel>
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="0.25*"></RowDefinition>
<RowDefinition Height="0.25*"></RowDefinition>
<RowDefinition Height="0.25*"></RowDefinition>
<RowDefinition Height="0.25*"></RowDefinition>
<RowDefinition Height="0.7*"></RowDefinition>
<RowDefinition Height="0.3*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.25*"></ColumnDefinition>
<ColumnDefinition Width="0.25*"></ColumnDefinition>
<ColumnDefinition Width="0.25*"/>
<ColumnDefinition Width="0.25*"></ColumnDefinition>
<ColumnDefinition Width="0.4*"></ColumnDefinition>
<ColumnDefinition Width="0.30*"></ColumnDefinition>
<ColumnDefinition Width="0.30*"></ColumnDefinition>
</Grid.ColumnDefinitions>

<Rectangle Name="first" Height="85" Width="85" Fill="LightGray" Grid.Column="0" Grid.Row="0" RadiusX="5" RadiusY="5"/>
<Rectangle Height="85" Width="85" Fill="LightGray" Grid.Column="1" Grid.Row="0" RadiusX="5" RadiusY="5"/>
<Rectangle Height="85" Width="85" Fill="LightGray" Grid.Column="2" Grid.Row="0" RadiusX="5" RadiusY="5"/>
<Rectangle Height="85" Width="85" Fill="LightGray" Grid.Column="3" Grid.Row="0" RadiusX="5" RadiusY="5"/>

<Rectangle Height="85" Width="85" Fill="LightGray" Grid.Column="0" Grid.Row="1" RadiusX="5" RadiusY="5"/>
<Rectangle Height="85" Width="85" Fill="LightGray" Grid.Column="1" Grid.Row="1" RadiusX="5" RadiusY="5"/>
<Rectangle Height="85" Width="85" Fill="LightGray" Grid.Column="2" Grid.Row="1" RadiusX="5" RadiusY="5"/>
<Rectangle Height="85" Width="85" Fill="LightGray" Grid.Column="3" Grid.Row="1" RadiusX="5" RadiusY="5"/>
<TextBlock Text="2048" FontSize="80" Margin="15 20 0 0" Foreground="#776e65" FontWeight="Bold" Grid.Column="0" Grid.Row="0"/>
<Rectangle Fill="#bbada0" Margin="40 30 0 50" RadiusX="10" RadiusY="10" Grid.Column="1"></Rectangle>
<Rectangle Fill="#bbada0" Margin="20 30 20 50" RadiusX="10" RadiusY="10" Grid.Column="2"></Rectangle>

<Rectangle Height="85" Width="85" Fill="LightGray" Grid.Column="0" Grid.Row="2" RadiusX="5" RadiusY="5"/>
<Rectangle Height="85" Width="85" Fill="LightGray" Grid.Column="1" Grid.Row="2" RadiusX="5" RadiusY="5"/>
<Rectangle Height="85" Width="85" Fill="LightGray" Grid.Column="2" Grid.Row="2" RadiusX="5" RadiusY="5"/>
<Rectangle Height="85" Width="85" Fill="LightGray" Grid.Column="3" Grid.Row="2" RadiusX="5" RadiusY="5"/>
<TextBlock Text="SCORE" Margin="40 35 0 30" TextAlignment="Center" Foreground="#eee4da" FontWeight="Bold" Grid.Column="1"/>
<TextBlock Name="scoreLabel" Text="1337" Margin="40 47 0 30" TextAlignment="Center" Foreground="#fff" FontWeight="Bold" FontSize="20" Grid.Column="1"/>

<TextBlock Text="AsTeFu" Margin="20 35 20 30" TextAlignment="Center" Foreground="#fff" FontWeight="Bold" FontSize="20" Grid.Column="2" MouseEnter="mouseEnterATF" MouseLeave="mouseLeaveATF" Name="ATF"/>

<Rectangle Height="85" Width="85" Fill="LightGray" Grid.Column="0" Grid.Row="3" RadiusX="5" RadiusY="5"/>
<Rectangle Height="85" Width="85" Fill="LightGray" Grid.Column="1" Grid.Row="3" RadiusX="5" RadiusY="5"/>
<Rectangle Height="85" Width="85" Fill="LightGray" Grid.Column="2" Grid.Row="3" RadiusX="5" RadiusY="5"/>
<Rectangle Height="85" Width="85" Fill="LightGray" Grid.Column="3" Grid.Row="3" RadiusX="5" RadiusY="5"/>
<Rectangle Height="50" Width="180" Margin="75 -20 0 0" RadiusX="10" RadiusY="10" Fill="#bbada0" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2"/>
<TextBlock Text="NEW GAME" Margin="75 -10 0 0" TextAlignment="Center" Foreground="#fff" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" FontSize="20" FontWeight="Bold" MouseDown="NewGame"/>
</Grid>
</Canvas>
<Canvas Height="400" Width="400" Name="main" Margin="50 30 50 10">

</Canvas>
<TextBlock Foreground="#776e65" FontSize="15" TextWrapping="Wrap" TextAlignment="Justify" Margin="55 0 55 10">
<Run FontWeight="Bold">HOW TO PLAY:</Run>
<Run>Use your</Run>
<Run FontWeight="Bold">arrow keys</Run>
<Run>or</Run>
<Run FontWeight="Bold">WASD</Run>
<Run>to move the tiles. When two tiles with the same number touch, they</Run>
<Run FontWeight="Bold">merge into one!</Run>
</TextBlock>
</StackPanel>

</Window>
Loading

0 comments on commit 00a7388

Please sign in to comment.