Migrated handling of grid and game to game.(c/h).

This commit is contained in:
Sheldon Lee
2020-06-24 14:27:24 +01:00
parent 1ad1660736
commit 50eeaa8f0a
5 changed files with 98 additions and 59 deletions
+7 -3
View File
@@ -36,7 +36,7 @@ int main()
const int FRAME_RATE = 30;
const float FRAME_TIME = 1.f/(float)FRAME_RATE;
//initGame();
initGame();
float t = 0;
while (isRunning()) {
@@ -45,9 +45,13 @@ int main()
handleInput(ch);
//drawGame();
drawGame();
drawLastPressed(ch);
drawCurPos();
refresh();
//updateGame();
updateGame();
usleep(pow(10,6)*(FRAME_TIME-t));
float t = (float) (clock()-start_t) / (float) CLOCKS_PER_SEC;