diff --git a/Torpedo/Torpedo/Game.cs b/Torpedo/Torpedo/Game.cs index f4395cf..0854e38 100644 --- a/Torpedo/Torpedo/Game.cs +++ b/Torpedo/Torpedo/Game.cs @@ -66,7 +66,7 @@ namespace Torpedo } } - public static void NextTurn() + public static void NextTurn(bool hit) { if (State == GameState.Prepare) { @@ -122,6 +122,8 @@ namespace Torpedo } if (Type == GameType.Singleplayer) { + if (hit) + return; GameForm.Instance.SetPanelsEnabled(false); Player.SwapPlayers(); if (Player.CurrentOwn == Player.Player2) @@ -131,6 +133,8 @@ namespace Torpedo } else if (Type == GameType.Multiplayer) { + if (hit) + return; Timer t = new Timer(); t.Interval = 2000; int c = 0; diff --git a/Torpedo/Torpedo/GameForm.Designer.cs b/Torpedo/Torpedo/GameForm.Designer.cs index d402bb9..1f46a53 100644 --- a/Torpedo/Torpedo/GameForm.Designer.cs +++ b/Torpedo/Torpedo/GameForm.Designer.cs @@ -44,7 +44,7 @@ // // ownPanel // - this.ownPanel.BackColor = System.Drawing.Color.DeepSkyBlue; + this.ownPanel.BackColor = System.Drawing.Color.Lime; this.ownPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.ownPanel.Location = new System.Drawing.Point(12, 27); this.ownPanel.Name = "ownPanel"; @@ -75,13 +75,13 @@ // többjátékosToolStripMenuItem // this.többjátékosToolStripMenuItem.Name = "többjátékosToolStripMenuItem"; - this.többjátékosToolStripMenuItem.Size = new System.Drawing.Size(84, 20); + this.többjátékosToolStripMenuItem.Size = new System.Drawing.Size(83, 20); this.többjátékosToolStripMenuItem.Text = "Többjátékos"; this.többjátékosToolStripMenuItem.Click += new System.EventHandler(this.GameTypeMenuClick); // // enemyPanel // - this.enemyPanel.BackColor = System.Drawing.Color.DeepSkyBlue; + this.enemyPanel.BackColor = System.Drawing.Color.Lime; this.enemyPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.enemyPanel.Location = new System.Drawing.Point(405, 27); this.enemyPanel.Name = "enemyPanel"; @@ -115,7 +115,7 @@ this.moveRightButton.Name = "moveRightButton"; this.moveRightButton.Size = new System.Drawing.Size(75, 75); this.moveRightButton.TabIndex = 4; - this.moveRightButton.Text = "Jobbra"; + this.moveRightButton.Text = "Jobb"; this.moveRightButton.UseVisualStyleBackColor = true; this.moveRightButton.Click += new System.EventHandler(this.MoveShip); // @@ -135,7 +135,7 @@ this.moveLeftButton.Name = "moveLeftButton"; this.moveLeftButton.Size = new System.Drawing.Size(75, 75); this.moveLeftButton.TabIndex = 6; - this.moveLeftButton.Text = "Le"; + this.moveLeftButton.Text = "Bal"; this.moveLeftButton.UseVisualStyleBackColor = true; this.moveLeftButton.Click += new System.EventHandler(this.MoveShip); // @@ -169,7 +169,7 @@ this.MinimizeBox = false; this.Name = "GameForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Torpedó"; + this.Text = "Csorpedóóó"; this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.ResumeLayout(false); diff --git a/Torpedo/Torpedo/GameForm.cs b/Torpedo/Torpedo/GameForm.cs index 21922b9..c0b2794 100644 --- a/Torpedo/Torpedo/GameForm.cs +++ b/Torpedo/Torpedo/GameForm.cs @@ -108,7 +108,7 @@ namespace Torpedo { shipSizeLabel.Text = ""; lastship = null; - Game.NextTurn(); + Game.NextTurn(false); } } @@ -153,7 +153,7 @@ namespace Torpedo ship.DamagedParts[clickedfield.Y - ship.Y] = true; } GameRenderer.Enemy.RenderGameField(); - Game.NextTurn(); + Game.NextTurn(ship != null); } private void Game_GameStateChange(object sender, GameStateChangeEventArgs e) diff --git a/Torpedo/Torpedo/OwnGameRenderer.cs b/Torpedo/Torpedo/OwnGameRenderer.cs index c6a6c33..fc3df12 100644 --- a/Torpedo/Torpedo/OwnGameRenderer.cs +++ b/Torpedo/Torpedo/OwnGameRenderer.cs @@ -21,7 +21,7 @@ namespace Torpedo { FieldTypeOwn.OwnShip, Color.LightGray }, { FieldTypeOwn.OwnShipDamaged, Color.DarkRed }, { FieldTypeOwn.OwnShipDestroyed, Color.Black }, - { FieldTypeOwn.Missed, Color.LightBlue } + { FieldTypeOwn.Missed, Color.LightBlue }, }); public void UpdateField(int x, int y, FieldTypeOwn fieldtype)