gure.y + 1 == VERTICAL_LINE)//Дно
{TRUE;
}
}
} (imp == 2)
{(g_iStok [c1 + g_pPozFigure.x] [y + g_pPozFigure.y + 1] gt; 30)//ЛініяTRUE;
}=0;
} FALSE;
}
//-----------------------------------------------------------------------------------------SaveGame()
{sgt ( Tetr.txt raquo ;, ios :: out | ios :: trunc);
if (! sgt.is_open ()) return;
sgt.clear ();
sgt.setf (ios_base :: fixed);
for (int c1=0; c1 lt; HORIZONTAL_LINE; c1 ++)
for (int c2=0; c2 lt; VERTICAL_LINE; c2 ++)
sgt lt; lt; g_iStok [c1] [c2] lt; lt; n raquo ;; lt; lt; g_iScore;
sgt.close ();
}
//-----------------------------------------------------------------------------------------LoadGame()
{[100]; ii;=0; SQR; _iInc=0;=HORIZONTAL_LINE * VERTICAL_LINE; SAr [451]; sgt ( Tetr.txt raquo ;, ios :: in);
while (! sgt.eof ()) { gt; gt; SAr [ii]; ++;
} gt; gt; SAr [SQR] ;. close (); _ iScore=SAr [SQR]; (g_iScore gt;=g_iLvlup [g_iInc])
{_ iInc ++;
} (szScore, TEXT ( Tetris Score:% d /% d lvl% d ), g_iScore, g_iLvlup [g_iInc], (g_iInc + 1)); (g_hwnd, szScore);
ii=0;
srand (GetTickCount ()% 100);
ClearFigure ( amp; g_bNextFigur [0] [0]);
g_iNextFigure=rand ()% FIGUR_COUNT;
GetFigure (g_iNextFigure);
for (int c1=0; c1 lt; HORIZONTAL_LINE; c1 ++)
for (int c2=0; c2 lt; VERTICAL_LINE; c2 ++)
{_ iStok [c1] [c2]=SAr [ii]; ++;
} (); ();
}
//-----------------------------------------------------------------------------------------OnCreate(HWND hwnd, LPCREATESTRUCT lpCreateStruct)
{_ hwnd=hwnd;
_hMenu=CreateMenu();=CreatePopupMenu();(hMenuPopapFile,MF_STRING,ID_MENU_NEW_GAME,TEXT(laquo;New gameraquo;));(hMenuPopapFile,MF_STRING,ID_MENU_SAVE,TEXT(laquo;Saveraquo;));(hMenuPopapFile,MF_STRING,ID_MENU_LOAD,TEXT(laquo;Loadraquo;));(hMenuPopapFile,MF_STRING,ID_MENU_EXIT,TEXT(laquo;Exitraquo;));(g_hMenu,MF_POPUP,(UINT)hMenuPopapFile,TEXT(laquo;Fileraquo;));(hwnd,g_hMenu);
TRUE;
}
//-----------------------------------------------------------------------------------------OnGetMinMaxInfo(HWND hwnd, LPMINMAXINFO lpMinMaxInfo)
{gt;ptMaxTrackSize.x=SIZE_WINDOW_X;gt;ptMaxTrackSize.y=SIZE_WINDOW_Y;gt;ptMinTrackSize.x=SIZE_WINDOW_X;gt;ptMinTrackSize.y=SIZE_WINDOW_Y;
}
//-----------------------------------------------------------------------------------------OnPaint(HWND hwnd)
{(); (); ps; (hwnd, amp; ps); (hwnd, amp; ps);
}
//-----------------------------------------------------------------------------------------EraseOldFigur()
{(int c1=0; c1 lt; 4; c1 ++) (int c2=0; c2 lt; 4; c2 ++) (g_bFigure [c1] [c2])
{_ iStok [c1 + g_pPozFigure.x] [c2 + g_pPozFigure.y]=30;
}
}
//-----------------------------------------------------------------------------------------PaintNewFigur()
{(int c1=0; c1 lt; 4; c1 ++) (int c2=0; c2 lt; 4; c2 ++) (g_bFigure [c1] [c2])
{_ iStok [c1 + g_pPozFigure.x] [c2 + g_pPozFigure.y]=g_iColor;
}
}
//-----------------------------------------------------------------------------------------LineClear()
{= FALSE; [100]; c1, c2;
{(c1=0; c1 lt; VERTICAL_LINE; c1 ++)
{(c2=0; c2 lt; HORIZONTAL_LINE; c2 ++)
{(g_iStok [c2] [c1] gt; 30)
{= TRUE;
}
{= FALSE ;;
}
} (bLineFill) break;=FALSE;
} (bLineFill)
{(; c1 gt; 0; c1 -)
{(c2=0; c2 lt; HORIZONTAL_LINE; c2 ++)
{_ iStok [c2] [c1]=g_iStok [c2] [c1-1];