Update render.c
This commit is contained in:
+8
-10
@@ -240,18 +240,16 @@ int display_grid() {
|
||||
//////////////// GAME LOGIC ////////////////
|
||||
|
||||
int game_logic(void) {
|
||||
// new_brick();
|
||||
count_col();
|
||||
printf("colcnt[%i]: %i, row: %i\n", col, colcnt[col], row);
|
||||
disp_column (row, col);
|
||||
grid[0][row - 2][col] = 0;
|
||||
disp_column (row, col); // update column in grid
|
||||
count_col(); // count number of empty spaces in each column
|
||||
if(row == colcnt[col]) {
|
||||
row = 0;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
tile_current[i] = tile_next[i];
|
||||
}
|
||||
new_brick();
|
||||
row = -1;
|
||||
col = new_column();
|
||||
// next column preview here
|
||||
new_brick();
|
||||
} else if (row == 16) {
|
||||
row = 0;
|
||||
}
|
||||
row++;
|
||||
}
|
||||
@@ -279,7 +277,7 @@ int Ren_game(void) {
|
||||
{
|
||||
current_time = SDL_GetTicks();
|
||||
deltatime = current_time - last_time;
|
||||
if (deltatime > 200) {
|
||||
if (deltatime > 500) {
|
||||
last_time = current_time;
|
||||
deltatime = 0;
|
||||
game_logic();
|
||||
|
||||
Reference in New Issue
Block a user