Курсовая работа: Программа "Морской бой"
if (n == 2) Im = Form1 -> Fild2;
if (key == «target»)
{
Im -> Canvas -> Rectangle (x*20, y*20, x*20 + 20, y*20 + 20);
Im -> Canvas -> Brush -> Color = clYellow;
Im -> Canvas -> Rectangle (x*20, y*20 + 20, x*20 + 20, y*20);
Im -> Canvas -> Brush -> Color = clWhite;
}
if (key == «miss»)
{
Im -> Canvas -> Ellipse (x*20, y*20, x*20 + 20, y*20 + 20);
Im -> Canvas -> Ellipse (x*20 + 5, y*20 + 5, x*20 + 15, y*20 + 15);
}
if (key == «position_h»)
{
for (i = 0; i < col_deck; i++)
{
Im -> Canvas -> Brush -> Color = clBlue;
Im -> Canvas -> Rectangle (x*20 + i*20, y*20, x*20 + 20 + i*20, y*20 + 20);
player -> ship [col_ship – 1].desp_of_part[i].x = x + i;
player -> ship [col_ship – 1].desp_of_part[i].y = y;
Im -> Canvas -> Brush -> Color = clWhite;
}
}
if (key == «position_v»)
{
for (i = 0; i < col_deck; i++)
{
Im -> Canvas -> Brush -> Color = clBlue;