Skip to content

Commit 5c025d2

Browse files
committed
Add EndGame - form and music :)
1 parent 4388e23 commit 5c025d2

37 files changed

+40095
-403
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

CYPVP/.vs/CYPVP/v17/.suo

7 KB
Binary file not shown.

CYPVP/CYPVP.csproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
<ItemGroup>
4949
<Compile Include="AudioManager.cs" />
5050
<Compile Include="Character.cs" />
51+
<Compile Include="EndGame.cs">
52+
<SubType>Form</SubType>
53+
</Compile>
54+
<Compile Include="EndGame.Designer.cs">
55+
<DependentUpon>EndGame.cs</DependentUpon>
56+
</Compile>
5157
<Compile Include="Form1.cs">
5258
<SubType>Form</SubType>
5359
</Compile>
@@ -73,6 +79,9 @@
7379
<Compile Include="Properties\AssemblyInfo.cs" />
7480
<Compile Include="Slime.cs" />
7581
<Compile Include="Star.cs" />
82+
<EmbeddedResource Include="EndGame.resx">
83+
<DependentUpon>EndGame.cs</DependentUpon>
84+
</EmbeddedResource>
7685
<EmbeddedResource Include="Form1.resx">
7786
<DependentUpon>Form1.cs</DependentUpon>
7887
</EmbeddedResource>
@@ -240,5 +249,11 @@
240249
<ItemGroup>
241250
<None Include="Resources\oscillating-space-waves-31400.wav" />
242251
</ItemGroup>
252+
<ItemGroup>
253+
<None Include="Resources\Epic Fail Sound Effect.wav" />
254+
</ItemGroup>
255+
<ItemGroup>
256+
<None Include="Resources\Yayyy Sound Effect.wav" />
257+
</ItemGroup>
243258
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
244259
</Project>

CYPVP/EndGame.Designer.cs

Lines changed: 158 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CYPVP/EndGame.cs

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Data;
5+
using System.Drawing;
6+
using System.Linq;
7+
using System.Media;
8+
using System.Text;
9+
using System.Threading.Tasks;
10+
using System.Windows.Forms;
11+
12+
namespace CYPVP
13+
{
14+
public partial class EndGame : Form
15+
{
16+
public int Points { get; set; }
17+
public SoundPlayer soundPlayer { get; set; }
18+
public EndGame(int points)
19+
{
20+
InitializeComponent();
21+
Points = points;
22+
lb_Points.Text = Points.ToString();
23+
if (GetGrade() == 10)
24+
{
25+
lb_Grade.Text = "10";
26+
}else if(GetGrade() == 4)
27+
{
28+
lb_Grade.Text = "5";
29+
}
30+
else
31+
{
32+
lb_Grade.Text = $"{GetGrade() + 1}";
33+
}
34+
if (GetGrade() > 5)
35+
{
36+
label3.Text = "Yeyy you passed Visual Programming";
37+
soundPlayer = new SoundPlayer(Properties.Resources.Yayyy_Sound_Effect);
38+
soundPlayer.Play();
39+
}
40+
else
41+
{
42+
soundPlayer = new SoundPlayer(Properties.Resources.Epic_Fail_Sound_Effect);
43+
soundPlayer.Play();
44+
}
45+
}
46+
47+
public int GetGrade()
48+
{
49+
if ((int)(Points / 10) < 5) return 4;
50+
if ((int)(Points / 10) >= 10) return 10;
51+
return (int)(Points / 10);
52+
}
53+
54+
private void EndGame_Load(object sender, EventArgs e)
55+
{
56+
57+
}
58+
59+
60+
61+
private void button2_Click(object sender, EventArgs e)
62+
{
63+
this.Close();
64+
Application.OpenForms["CYPVP"].Show();
65+
CYPVP.Menu.Play();
66+
}
67+
}
68+
}

0 commit comments

Comments
 (0)