Click here to Skip to main content
15,888,301 members
Articles / Desktop Programming / WPF

Targets

Rate me:
Please Sign up or sign in to vote.
4.94/5 (32 votes)
15 Apr 2011CPOL6 min read 65.3K   2.3K   41  
A WPF Target Shooting Game
<UserControl
	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"
	mc:Ignorable="d"
	x:Class="GlockRound"
	x:Name="UserControl"
	d:DesignWidth="9" d:DesignHeight="22.084" Width="9" Height="22.084">

	<Grid x:Name="LayoutRoot">
		<Canvas x:Name="TheBullet" Background="#03000000">
			<Viewbox x:Name="Bullet" Width="7.602" Height="22.339" Canvas.Left="0.75" Canvas.Top="-0.255" Opacity="0.975">
				<Canvas Width="9.18958" Height="22.3394">
					<Path x:Name="Path" Width="8.872" Height="2.307" Canvas.Left="0.152" Canvas.Top="21.951" Stretch="Fill" Data="F1 M9.0233508,20.355885 L7.9285362,22.346087 1.0964977,22.313192 0.15256307,20.372333 9.0233508,20.355885 z">
						<Path.Fill>
							<LinearGradientBrush EndPoint="1.017,-0.148" StartPoint="0.138,0.864">
								<GradientStop Color="#FF7E7E7E" Offset="0"/>
								<GradientStop Color="#FFDEDEDE" Offset="1"/>
								<GradientStop Color="#FE767676" Offset="0.066"/>
							</LinearGradientBrush>
						</Path.Fill>
					</Path>
					<Path x:Name="Path_0" Width="8.713" Height="6.911" Canvas.Left="0.204" Canvas.Top="0.003" Stretch="Fill" Data="F1 M 8.88922,6.29669C 8.7739,4.04977 8.39301,2.35541 6.47345,0.925964C 5.36429,0 3.75784,0.0545044 2.53258,0.953003C 0.898911,2.38245 0.292709,4.13885 0.204224,6.54852L 8.91718,6.54172L 8.88922,6.29669 Z ">
						<Path.Fill>
							<RadialGradientBrush GradientOrigin="0.003,1" RadiusX="0.511" RadiusY="0.665">
								<GradientStop Color="#FFECECEC"/>
								<GradientStop Color="#FF535353" Offset="1"/>
								<GradientStop Color="#FFEAEAEA" Offset="0.44"/>
							</RadialGradientBrush>
						</Path.Fill>
					</Path>
					<Path x:Name="Path_1" Width="9.149" Height="15.477" Canvas.Left="0" Canvas.Top="6.483" Stretch="Fill" Data="F1 M 0,20.479L 9.14861,20.479L 9.14861,6.48386C 9.14861,6.30344 9.00232,6.15717 8.82187,6.15717L 0.326736,6.15717C 0.146286,6.15717 0,6.30344 0,6.48386L 0,20.479 Z ">
						<Path.Fill>
							<LinearGradientBrush EndPoint="0.983,0.5" StartPoint="-0.024,0.5">
								<GradientStop Color="#FFF2F2F2" Offset="0"/>
								<GradientStop Color="#FFF0F0F0" Offset="1"/>
								<GradientStop Color="#FF929292" Offset="0.737"/>
								<GradientStop Color="White" Offset="0.409"/>
								<GradientStop Color="#FFD5D5D5" Offset="0.569"/>
							</LinearGradientBrush>
						</Path.Fill>
					</Path>
					<Path x:Name="Path_2" Width="9.073" Height="0.957" Canvas.Top="23.358" Stretch="Fill" Data="F1 M 8.75352,21.4673L 0.463409,21.4673C 0.222595,21.4673 0.027359,21.6625 0.027359,21.9033L 0.027359,21.9033C 0.027359,22.1441 0.222595,22.3394 0.463409,22.3394L 8.75352,22.3394C 8.99435,22.3394 9.18958,22.1441 9.18958,21.9033L 9.18958,21.9033C 9.18958,21.6625 8.99435,21.4673 8.75352,21.4673 Z ">
						<Path.Fill>
							<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
								<GradientStop Color="#FF575757" Offset="0"/>
								<GradientStop Color="White" Offset="1"/>
								<GradientStop Color="#FFD2D2D2" Offset="0.142"/>
								<GradientStop Color="#FF656565" Offset="0.125"/>
							</LinearGradientBrush>
						</Path.Fill>
					</Path>
					<Rectangle x:Name="Rectangle" Width="9.138" Height="0.362" Canvas.Left="0.007" Canvas.Top="21.634" Stretch="Fill" Fill="#FFB7B7B7"/>
					<Path x:Name="Path_3" Width="8.978" Height="0.452" Canvas.Left="0.095" Canvas.Top="6.543" Stretch="Fill" Fill="#FFA5A5A5" Data="F1 M 8.86775,6.21149L 0.30072,6.21149C 0.187103,6.21149 0.0950165,6.30356 0.0950165,6.41718L 0.0950165,6.41718C 0.0950165,6.53076 0.187103,6.62289 0.30072,6.62289L 8.86775,6.62289C 8.98135,6.62289 9.07346,6.53076 9.07346,6.41718L 9.07346,6.41718C 9.07346,6.30356 8.98135,6.21149 8.86775,6.21149 Z "/>
				</Canvas>
			</Viewbox>
		</Canvas>
	</Grid>
</UserControl>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Kenya Kenya
Experienced C# software developer with a passion for WPF.

Awards,
  • CodeProject MVP 2013
  • CodeProject MVP 2012
  • CodeProject MVP 2021

Comments and Discussions