fy"> checkCoords ()
{(y <0)
{
y + +;
remove ();. Inv ();;
} (y> 18)
{
y -;
remove ();. Inv ();;
} (x <0)
{
x + +;
remove ();. Inv ();;
} (x> 9)
{
x -;
remove ();. Inv ();;
} (MainWindow.table [x, y] == true)
{
remove ();. Inv ();
DestroyObj ();;
};
} DestroyObj ()
{(MainWindow.Tanks_.Tank_.inMe (x, y))
{. Tanks_.Tank_.wounded ();;
} (MainWindow.Tanks_.Tank_1.inMe (x, y))
{. Tanks_.Tank_1.wounded ();;
}
}
}
}
КлассTank - відповідає за танк у грі
{
{Tank (string p = null, bool ToTable = false, string n = "player")
{(p! = null)
createTank (p); (ToTable)
toTable ();
name = n;
} health = 3; score = 0; cheat = 5; name = ""; [,] coord = {
{0,0},// ​​x, y
{0,0},
{0,0},
{0,0}
}; [,] tcoord = {
{0,0},// ​​x, y
{0,0},
{0,0},
{0,0}
}; state = 1; speedShots = 0; setCoord (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
{
coord [0, 0] = x1;
coord [0, 1] = y1;
coord [1, 0] = x2;
coord [1, 1] = y2;
coord [2, 0] = x3;
coord [2, 1] = y3;
coord [3, 0] = x4;
coord [3, 1] = y4;
} tmoveCoord (int id, string d, int c = 1)
{(int i = 0; i
{(d)
{"Left":
tcoord [id, 0] = tcoord [id, 0] - 1; break; "Right":
tcoord [id, 0] = tcoord [id, 0] + 1; break; "Up":
tcoord [id, 1] = tcoord [id, 1] - 1; break; "Down":
tcoord [id, 1] = tcoord [id, 1] + 1; break;
}
}
} checkCoord (int [,] m)
...