-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
113 lines (111 loc) · 6.66 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<Window x:Name="FlappyBird" x:Class="CrappyBird.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:CrappyBird"
mc:Ignorable="d"
Title="FlappyBird" Focusable="True" Height="542" Width="942" ResizeMode="NoResize" Icon="/favicon.ico">
<Canvas Name="mainCanvas" Focusable="True" KeyDown="keyIsDown" KeyUp="keyIsUp" Margin="0,-30,0,-5">
<Canvas.Background>
<ImageBrush ImageSource="/background-day.png" Stretch="Fill" TileMode="None"/>
</Canvas.Background>
<Image Height="390" Width="66" Source="/pipe-green.png" Tag="pipe1" Canvas.Left="358" Canvas.Top="384" HorizontalAlignment="Center" VerticalAlignment="Top" Stretch="Fill" >
<Image.Effect>
<DropShadowEffect/>
</Image.Effect>
</Image>
<Image Height="390" Width="66" Source="/pipe-green-upside-down.png" Tag="pipe1" Canvas.Left="358" Canvas.Top="-138" HorizontalAlignment="Center" VerticalAlignment="Top" Stretch="Fill" RenderTransformOrigin="0.5,0.5" >
<Image.Effect>
<DropShadowEffect/>
</Image.Effect>
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="0"/>
<TranslateTransform/>
</TransformGroup>
</Image.RenderTransform>
</Image>
<Image Height="390" Width="66" Source="/pipe-green.png" Tag="pipe2" Canvas.Left="525" Canvas.Top="272" HorizontalAlignment="Left" VerticalAlignment="Center" Stretch="Fill" >
<Image.Effect>
<DropShadowEffect/>
</Image.Effect>
</Image>
<Image Height="390" Width="66" Source="/pipe-green-upside-down.png" Tag="pipe2" Canvas.Left="525" Canvas.Top="-235" HorizontalAlignment="Left" VerticalAlignment="Center" Stretch="Fill" RenderTransformOrigin="0.5,0.5" >
<Image.Effect>
<DropShadowEffect/>
</Image.Effect>
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="0"/>
<TranslateTransform/>
</TransformGroup>
</Image.RenderTransform>
</Image>
<Image Height="390" Width="66" Source="/pipe-green.png" Tag="pipe3" Canvas.Left="708" Canvas.Top="346" HorizontalAlignment="Center" VerticalAlignment="Top" Stretch="Fill" >
<Image.Effect>
<DropShadowEffect/>
</Image.Effect>
</Image>
<Image Height="390" Width="64" Source="/pipe-green-upside-down.png" Tag="pipe3" Canvas.Left="708" Canvas.Top="-157" HorizontalAlignment="Center" VerticalAlignment="Top" Stretch="Fill" RenderTransformOrigin="0.5,0.5" >
<Image.Effect>
<DropShadowEffect/>
</Image.Effect>
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="0"/>
<TranslateTransform/>
</TransformGroup>
</Image.RenderTransform>
</Image>
<Image Name="Bird" Height="36" Width="50" Source="/bluebird-upflap.png" Canvas.Top="190" Canvas.Left="10" HorizontalAlignment="Center" VerticalAlignment="Top" />
<Label Content="Score: " Name="scoreLBL" Canvas.Left="10" Canvas.Top="34" FontSize="22" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Top"></Label>
<Canvas x:Name="gameOverCanvas" Background="LightCoral" Height="561" Width="942" Canvas.Left="977" HorizontalAlignment="Center" VerticalAlignment="Top">
<Label Name="gameOverScoreLBL" Canvas.Left="297" Canvas.Top="250" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="16" FontWeight="Bold">Score: 0
</Label>
<Button x:Name="retryBTN" Canvas.Left="354" Canvas.Top="307" Height="52" Width="234" FontSize="22" FontWeight="Bold" Content="Retry" Click="retryBTN_Click" HorizontalAlignment="Left" VerticalAlignment="Top">
<Button.Effect>
<DropShadowEffect/>
</Button.Effect>
<Button.Background>
<ImageBrush ImageSource="/button_background.png"/>
</Button.Background>
</Button>
<Image Height="76" Canvas.Left="292" Canvas.Top="169" Width="357" Source="/gameover.png" HorizontalAlignment="Center" VerticalAlignment="Center">
<Image.Effect>
<DropShadowEffect/>
</Image.Effect>
</Image>
<Button x:Name="titleScreenBTN" Canvas.Left="354" Canvas.Top="380" Height="52" Width="234" FontSize="22" FontWeight="Bold" Content="Title Screen" Click="titleScreenBTN_Click" HorizontalAlignment="Center" VerticalAlignment="Top">
<Button.Effect>
<DropShadowEffect/>
</Button.Effect>
<Button.Background>
<ImageBrush ImageSource="/button_background.png"/>
</Button.Background>
</Button>
</Canvas>
<Canvas x:Name="titleScreenCanvas" Background="LightBlue" Height="561" Width="942" Canvas.Left="-970" HorizontalAlignment="Center" VerticalAlignment="Top">
<Image Height="379" Canvas.Left="340" Canvas.Top="91" Width="273" Source="/message.png" HorizontalAlignment="Left" VerticalAlignment="Center">
<Image.Effect>
<DropShadowEffect/>
</Image.Effect>
</Image>
<Button x:Name="startGameBTN" Canvas.Left="400" Canvas.Top="326" Height="52" Width="142" Content="Start Game" Click="startGameBTN_Click" FontSize="22" FontWeight="Bold">
<Button.Effect>
<DropShadowEffect/>
</Button.Effect>
<Button.Background>
<ImageBrush ImageSource="/button_background.png"/>
</Button.Background>
</Button>
</Canvas>
<Image Name="ground" Tag="ground" Height="106" Canvas.Top="455" Width="942" Source="/base.png" HorizontalAlignment="Center" VerticalAlignment="Top" Stretch="Fill" Panel.ZIndex="1"/>
</Canvas>
</Window>