WPF Padding Ball game in VB.NET

This article shows the programming of padding ball game in WPF.
  • 3606

In this article you will see the programming of "Paddling Ball" game using WPF technology. In this game the ball moves around all corners of your screen and you have to prevent the ball falling down with the help of pad on the bottom of the screen.

You can use left and right to move the ball. Now lets see the programming code for the game and enjoy game.

WPF Code

<Window x:Class="PaddingBall.Window1"
    Title="WPF Padding Ball Game" Height="500" Width="700" Background="LightSkyBlue" Name="playground" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" SizeToContent="Manual">
    <Canvas Width="700" Height="500">
        <Menu VerticalAlignment="Top" HorizontalAlignment="Left"           
             Height="20" Width="700" Background="AliceBlue" Foreground="Blue">
            <MenuItem Header="File">
                <MenuItem Header="Start Game" Background="AliceBlue" Click="StartGame"></MenuItem>
                <MenuItem Header="Exit" Background="AliceBlue" Click="ExitGame"></MenuItem>
            <MenuItem Header="About" Click="ShowAboutBox"></MenuItem>
        <Grid Height="462" Width="700">
            <ColumnDefinition Width="700*" />
            <ColumnDefinition Width="0*" />
            <ColumnDefinition Width="0*" />
        <Rectangle Margin="114,132,0,0" Name="ball" Stroke="Black" RadiusX="120" RadiusY="120" Fill="Wheat" Height="38"
VerticalAlignment="Top" Stretch="UniformToFill" HorizontalAlignment="Left" Width="38">
                <BevelBitmapEffect BevelWidth="11" />
                <BitmapEffectInput />
        <Rectangle Height="13" Margin="200,390,0,0" Name="pad" Stroke="Black" VerticalAlignment="Bottom" Fill="Black" HorizontalAlignment="Left" Width="100" />

Output Window


I hope you really like this.


More Articles

© 2020 DotNetHeaven. All rights reserved.