Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

Commit

Permalink
Fix #2 everything is fine
Browse files Browse the repository at this point in the history
  • Loading branch information
Vassterak committed Nov 19, 2021
1 parent 6c26199 commit 8fe2cd9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Gorillas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private void GorillaSpawn(int leftPosition, int topPosition, int index)
{
if (index < 3) //of course I'm writing the most efficient code... As I always did...
{
gorillaSprite1.Fill = new ImageBrush(new BitmapImage(new Uri(@"pack://application:,,,/Resources/gorilla.png", UriKind.Absolute))); //Microsoft's horrible image implementation
gorillaSprite1.Fill = new ImageBrush(new BitmapImage(new Uri(@"pack://application:,,,/Resources/gorilla.png", UriKind.Absolute)));
gorillaSprite1.Width = GorillaSize;
gorillaSprite1.Height = GorillaSize;
Canvas.SetLeft(gorillaSprite1, leftPosition);
Expand All @@ -110,7 +110,7 @@ private void GorillaSpawn(int leftPosition, int topPosition, int index)

else
{
gorillaSprite2.Fill = new ImageBrush(new BitmapImage(new Uri(@"pack://application:,,,/Resources/gorilla.png", UriKind.Absolute))); //Microsoft's horrible image implementation
gorillaSprite2.Fill = new ImageBrush(new BitmapImage(new Uri(@"pack://application:,,,/Resources/gorilla.png", UriKind.Absolute)));
gorillaSprite2.Width = GorillaSize;
gorillaSprite2.Height = GorillaSize;
Canvas.SetLeft(gorillaSprite2, leftPosition);
Expand Down
3 changes: 1 addition & 2 deletions GorillasScreen.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WPF_Game_Gorillas"
mc:Ignorable="d"
Title="Gorillas - Game" MinWidth="896" MinHeight="504" MaxWidth="896" MaxHeight="504" SourceInitialized="Window_SourceInitialized">
<!--896 x 504 => 16:9 aspect ratio-->
Title="Gorillas - Game" MinWidth="896" MinHeight="504" MaxWidth="896" MaxHeight="504" SourceInitialized="Window_SourceInitialized"> <!--896 x 504 => 16:9 aspect ratio-->
<Canvas x:Name="gameCanvas" Background="DarkBlue">
<Grid x:Name="UserInputsGrid" Width="{Binding ElementName=gameCanvas, Path=ActualWidth}" Height="90" >
<Grid.RowDefinitions>
Expand Down
8 changes: 8 additions & 0 deletions GorillasScreen.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ private void nextRoundButton_Click(object sender, RoutedEventArgs e)
}
}

//Reset input values to make it harder (you need to remeber your previous values)

player1Angle.Text = "";
player1Power.Text = "";

player2Angle.Text = "";
player2Power.Text = "";

if (!exceptionThrown)
gorillasGame.ThrowCalculation();
}
Expand Down

0 comments on commit 8fe2cd9

Please sign in to comment.