This commit is contained in:
Dávid 2016-03-20 18:23:45 +00:00 committed by NorbiPeti
parent 8eaab232b5
commit 79b71820e8
4 changed files with 14 additions and 10 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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)

View file

@ -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)