Skip to content

Commit 7d71345

Browse files
committed
esc event
1 parent ce9eb78 commit 7d71345

File tree

7 files changed

+27
-3
lines changed

7 files changed

+27
-3
lines changed

Characters/Coin.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ public override void Draw(Graphics gp)
7474
if (index >= 7) Location = GetLocation();
7575
else Location.X = frmMain.iWidth;
7676
if (index != 8) bVisible = true;
77-
Location.Y += random.Next(-20, 20);
7877
}
7978
}
8079
}

OGGY.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
2424
<UpdatePeriodically>false</UpdatePeriodically>
2525
<UpdateRequired>false</UpdateRequired>
26-
<MapFileExtensions>true</MapFileExtensions>
26+
<MapFileExtensions>false</MapFileExtensions>
2727
<SupportUrl>https://www.facebook.com/01.tien</SupportUrl>
2828
<ProductName>OGGY</ProductName>
2929
<PublisherName>MTQK</PublisherName>

UI/EndGame.Designer.cs

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

UI/EndGame.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,11 @@ private void picClose_Click(object sender, EventArgs e)
2020
{
2121
this.Dispose();
2222
}
23+
24+
private void EndGame_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
25+
{
26+
if (e.KeyCode == Keys.Escape || e.KeyCode == Keys.Enter)
27+
this.Dispose();
28+
}
2329
}
2430
}

UI/frmMenu.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Drawing;
44
using System.Media;
55
using System.Windows.Forms;
6+
using System.Windows.Input;
67

78
namespace OGGY
89
{
@@ -39,7 +40,10 @@ private void PlayFXMucsic()
3940
picFXMusic.BackgroundImage = OGGY.Properties.Resources.opt_nomusic;
4041
}
4142

42-
private void PicExit_Click(object sender, EventArgs e)
43+
/// <summary>
44+
/// Khi nguoi choi muon thoat game
45+
/// </summary>
46+
private void Exit()
4347
{
4448
DialogResult traLoi = MessageBox.Show("Bạn muốn thoát game chứ?", "Xác nhận", MessageBoxButtons.YesNo);
4549
if (traLoi == DialogResult.Yes)
@@ -56,6 +60,11 @@ private void PicExit_Click(object sender, EventArgs e)
5660
}
5761
}
5862

63+
private void PicExit_Click(object sender, EventArgs e)
64+
{
65+
Exit();
66+
}
67+
5968
private void PicInfo_Click(object sender, EventArgs e)
6069
{
6170
string info = "\t\t GAME OGGY \n\n\n (c) Nguyễn Huỳnh Minh Tiến & Hồ Quốc Khánh \n\n\t\t FIT-HCMUTE";
@@ -115,5 +124,11 @@ private void EventClick(object sender, MouseEventArgs e)
115124
lblHighScore.Text = iHighScore.ToString();
116125
}
117126
}
127+
128+
private void frmMenu_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
129+
{
130+
if (e.KeyCode == Keys.Escape)
131+
Exit();
132+
}
118133
}
119134
}

UI/frmMenu.designer.cs

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

publish.rar

30.4 MB
Binary file not shown.

0 commit comments

Comments
 (0)