focking update

This commit is contained in:
Heli-o 2021-05-30 21:47:54 +02:00
parent ccd4c82342
commit f366db6ed9
28 changed files with 79 additions and 54 deletions

Binary file not shown.

View file

@ -10,10 +10,17 @@ namespace Catch_the_button {
static SoundPlayer hit = new SoundPlayer(); static SoundPlayer hit = new SoundPlayer();
static SoundPlayer miss = new SoundPlayer(); static SoundPlayer miss = new SoundPlayer();
static SoundPlayer levelup = new SoundPlayer(); static SoundPlayer levelup = new SoundPlayer();
static SoundPlayer gamestart = new SoundPlayer();
static internal void Init() { static internal void Init() {
hit.SoundLocation = "./resources/hit.wav"; hit.SoundLocation = "./resources/hit.wav";
miss.SoundLocation = "./resources/miss.wav"; miss.SoundLocation = "./resources/miss.wav";
levelup.SoundLocation = "./resources/levelup.wav"; levelup.SoundLocation = "./resources/levelup.wav";
gamestart.SoundLocation = "./resources/game-start.wav";
hit.Load();
miss.Load();
levelup.Load();
gamestart.Load();
} }
static internal void Hit() { static internal void Hit() {
hit.Play(); hit.Play();
@ -24,5 +31,8 @@ namespace Catch_the_button {
static internal void LevelUp() { static internal void LevelUp() {
levelup.Play(); levelup.Play();
} }
static internal void Play() {
gamestart.Play();
}
} }
} }

View file

@ -67,7 +67,6 @@ namespace Catch_the_button {
formResetter.Stop(); formResetter.Stop();
} }
static internal void Start() { //pressed button start static internal void Start() { //pressed button start
AudioSystem.Init();
points = miss = 0; points = miss = 0;
delay = 2000; delay = 2000;
btn.Visible = btn.Enabled = true; btn.Visible = btn.Enabled = true;
@ -76,6 +75,7 @@ namespace Catch_the_button {
btn.Location = new Point((frm.Width - btn.Width) / 2, (frm.Height - btn.Height) / 2); btn.Location = new Point((frm.Width - btn.Width) / 2, (frm.Height - btn.Height) / 2);
status = true; status = true;
timer.Interval = delay; timer.Interval = delay;
AudioSystem.Play();
} }
static void Go() { //first button hit static void Go() { //first button hit
timer.Start(); timer.Start();

View file

@ -39,7 +39,7 @@ namespace Catch_the_button {
this.score.Location = new System.Drawing.Point(13, 80); this.score.Location = new System.Drawing.Point(13, 80);
this.score.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.score.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.score.Name = "score"; this.score.Name = "score";
this.score.Size = new System.Drawing.Size(190, 29); this.score.Size = new System.Drawing.Size(238, 36);
this.score.TabIndex = 0; this.score.TabIndex = 0;
this.score.Text = "Your score is: ..."; this.score.Text = "Your score is: ...";
// //
@ -49,7 +49,7 @@ namespace Catch_the_button {
this.label1.Location = new System.Drawing.Point(14, 123); this.label1.Location = new System.Drawing.Point(14, 123);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(210, 24); this.label1.Size = new System.Drawing.Size(267, 29);
this.label1.TabIndex = 1; this.label1.TabIndex = 1;
this.label1.Text = "Please enter your name"; this.label1.Text = "Please enter your name";
// //
@ -59,7 +59,7 @@ namespace Catch_the_button {
this.label2.Location = new System.Drawing.Point(14, 147); this.label2.Location = new System.Drawing.Point(14, 147);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(295, 24); this.label2.Size = new System.Drawing.Size(377, 29);
this.label2.TabIndex = 2; this.label2.TabIndex = 2;
this.label2.Text = "(leave blank to not save the score)"; this.label2.Text = "(leave blank to not save the score)";
// //
@ -68,7 +68,7 @@ namespace Catch_the_button {
this.name.Location = new System.Drawing.Point(18, 187); this.name.Location = new System.Drawing.Point(18, 187);
this.name.Margin = new System.Windows.Forms.Padding(4, 7, 4, 7); this.name.Margin = new System.Windows.Forms.Padding(4, 7, 4, 7);
this.name.Name = "name"; this.name.Name = "name";
this.name.Size = new System.Drawing.Size(373, 28); this.name.Size = new System.Drawing.Size(373, 34);
this.name.TabIndex = 3; this.name.TabIndex = 3;
// //
// submit // submit
@ -89,13 +89,13 @@ namespace Catch_the_button {
this.label3.Location = new System.Drawing.Point(63, 9); this.label3.Location = new System.Drawing.Point(63, 9);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(272, 55); this.label3.Size = new System.Drawing.Size(339, 69);
this.label3.TabIndex = 5; this.label3.TabIndex = 5;
this.label3.Text = "Game Over"; this.label3.Text = "Game Over";
// //
// LeaderDialog // LeaderDialog
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 22F); this.AutoScaleDimensions = new System.Drawing.SizeF(14F, 29F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(408, 290); this.ClientSize = new System.Drawing.Size(408, 290);
this.Controls.Add(this.label3); this.Controls.Add(this.label3);
@ -108,6 +108,10 @@ namespace Catch_the_button {
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.KeyPreview = true; this.KeyPreview = true;
this.Margin = new System.Windows.Forms.Padding(4, 7, 4, 7); this.Margin = new System.Windows.Forms.Padding(4, 7, 4, 7);
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(426, 337);
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(426, 337);
this.Name = "LeaderDialog"; this.Name = "LeaderDialog";
this.Text = "Leaderboards"; this.Text = "Leaderboards";
this.Load += new System.EventHandler(this.Form2_Load); this.Load += new System.EventHandler(this.Form2_Load);

View file

@ -25,6 +25,10 @@ namespace Catch_the_button {
/// </summary> /// </summary>
private void InitializeComponent() { private void InitializeComponent() {
this.Menu = new System.Windows.Forms.Panel(); this.Menu = new System.Windows.Forms.Panel();
this.label11 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.button = new System.Windows.Forms.Label(); this.button = new System.Windows.Forms.Label();
this.stats = new System.Windows.Forms.Panel(); this.stats = new System.Windows.Forms.Panel();
this.milestone = new System.Windows.Forms.Label(); this.milestone = new System.Windows.Forms.Label();
@ -45,10 +49,6 @@ namespace Catch_the_button {
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.quit = new System.Windows.Forms.Button(); this.quit = new System.Windows.Forms.Button();
this.start = new System.Windows.Forms.Button(); this.start = new System.Windows.Forms.Button();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.Menu.SuspendLayout(); this.Menu.SuspendLayout();
this.stats.SuspendLayout(); this.stats.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
@ -81,6 +81,42 @@ namespace Catch_the_button {
this.Menu.Size = new System.Drawing.Size(961, 521); this.Menu.Size = new System.Drawing.Size(961, 521);
this.Menu.TabIndex = 0; this.Menu.TabIndex = 0;
// //
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(12, 393);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(120, 23);
this.label11.TabIndex = 1005;
this.label11.Text = "Miss: -1pt";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(12, 370);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(252, 23);
this.label10.TabIndex = 1004;
this.label10.Text = "Click after 500ms: 1pt";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(12, 347);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(241, 23);
this.label8.TabIndex = 1;
this.label8.Text = "Click in <500ms: 2pts";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(12, 324);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(87, 23);
this.label9.TabIndex = 1003;
this.label9.Text = "Points:";
//
// button // button
// //
this.button.Anchor = System.Windows.Forms.AnchorStyles.None; this.button.Anchor = System.Windows.Forms.AnchorStyles.None;
@ -306,42 +342,6 @@ namespace Catch_the_button {
this.start.UseVisualStyleBackColor = true; this.start.UseVisualStyleBackColor = true;
this.start.Click += new System.EventHandler(this.start_Click); this.start.Click += new System.EventHandler(this.start_Click);
// //
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(12, 347);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(241, 23);
this.label8.TabIndex = 1;
this.label8.Text = "Click in <500ms: 2pts";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(12, 324);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(87, 23);
this.label9.TabIndex = 1003;
this.label9.Text = "Points:";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(12, 370);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(252, 23);
this.label10.TabIndex = 1004;
this.label10.Text = "Click after 500ms: 1pt";
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(12, 393);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(120, 23);
this.label11.TabIndex = 1005;
this.label11.Text = "Miss: -1pt";
//
// Main // Main
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 23F); this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 23F);
@ -352,6 +352,9 @@ namespace Catch_the_button {
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.KeyPreview = true; this.KeyPreview = true;
this.Margin = new System.Windows.Forms.Padding(4); this.Margin = new System.Windows.Forms.Padding(4);
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(981, 567);
this.MinimumSize = new System.Drawing.Size(981, 567);
this.Name = "Main"; this.Name = "Main";
this.Text = "Catch the Button 2"; this.Text = "Catch the Button 2";
this.Load += new System.EventHandler(this.Form1_Load); this.Load += new System.EventHandler(this.Form1_Load);

View file

@ -14,13 +14,13 @@ namespace Catch_the_button {
public Main() { public Main() {
InitializeComponent(); InitializeComponent();
} }
private void start_Click(object sender, EventArgs e) { private void start_Click(object sender, EventArgs e) {
Game.Start(); Game.Start();
} }
private void Form1_Load(object sender, EventArgs e) { private void Form1_Load(object sender, EventArgs e) {
Game.Init(ptsCount, hp, Menu, button, this, timeleft, milestone); Game.Init(ptsCount, hp, Menu, button, this, timeleft, milestone);
AudioSystem.Init();
Leaderboard.Init(ldrboard, this, highscore); Leaderboard.Init(ldrboard, this, highscore);
button.Parent = stats.Parent = this; button.Parent = stats.Parent = this;
} }

Binary file not shown.

View file

@ -1 +1 @@
ahoj:28 Helio:90

Binary file not shown.

Binary file not shown.

View file

@ -1,4 +1 @@
test:69 Helio:90
helo 000:38
helio 2.9:28
Helio 3.0 rev 2:82

Binary file not shown.

Binary file not shown.

View file

@ -1 +1 @@
aabdfd7f744b6ad22ce51304f1c72f99ab00735e 7e7e98c865c1df8538bd0356387b4b01a47eae0b

View file

@ -20,3 +20,14 @@ C:\Users\vasik\Documents\GitHub\Catch-the-Button-2\Catch the button\obj\Release\
C:\Users\vasik\Documents\GitHub\Catch-the-Button-2\Catch the button\obj\Release\Catch the button.csproj.CoreCompileInputs.cache C:\Users\vasik\Documents\GitHub\Catch-the-Button-2\Catch the button\obj\Release\Catch the button.csproj.CoreCompileInputs.cache
C:\Users\vasik\Documents\GitHub\Catch-the-Button-2\Catch the button\obj\Release\Catch the button.exe C:\Users\vasik\Documents\GitHub\Catch-the-Button-2\Catch the button\obj\Release\Catch the button.exe
C:\Users\vasik\Documents\GitHub\Catch-the-Button-2\Catch the button\obj\Release\Catch the button.pdb C:\Users\vasik\Documents\GitHub\Catch-the-Button-2\Catch the button\obj\Release\Catch the button.pdb
C:\Users\helio\Documents\Catch-the-Button-2\Catch the button\bin\Release\Catch the button.exe.config
C:\Users\helio\Documents\Catch-the-Button-2\Catch the button\bin\Release\Catch the button.exe
C:\Users\helio\Documents\Catch-the-Button-2\Catch the button\bin\Release\Catch the button.pdb
C:\Users\helio\Documents\Catch-the-Button-2\Catch the button\obj\Release\Catch the button.csproj.AssemblyReference.cache
C:\Users\helio\Documents\Catch-the-Button-2\Catch the button\obj\Release\Catch_the_button.Main.resources
C:\Users\helio\Documents\Catch-the-Button-2\Catch the button\obj\Release\Catch_the_button.LeaderDialog.resources
C:\Users\helio\Documents\Catch-the-Button-2\Catch the button\obj\Release\Catch_the_button.Properties.Resources.resources
C:\Users\helio\Documents\Catch-the-Button-2\Catch the button\obj\Release\Catch the button.csproj.GenerateResource.cache
C:\Users\helio\Documents\Catch-the-Button-2\Catch the button\obj\Release\Catch the button.csproj.CoreCompileInputs.cache
C:\Users\helio\Documents\Catch-the-Button-2\Catch the button\obj\Release\Catch the button.exe
C:\Users\helio\Documents\Catch-the-Button-2\Catch the button\obj\Release\Catch the button.pdb