Update render.c
This commit is contained in:
+7
-9
@@ -9,17 +9,9 @@
|
||||
#include "sdl.h"
|
||||
#include "research.h"
|
||||
|
||||
extern int spr_x[5][6];
|
||||
extern int grid[2][18][8];
|
||||
extern SDL_Renderer *sr;
|
||||
extern SDL_Texture * texture;
|
||||
extern int tile_pos;
|
||||
extern bool next_p; // next piece flag
|
||||
|
||||
int tile_shp = 1;
|
||||
int tilesrc_x, tilesrc_y, tiledst_x, tiledst_y;
|
||||
int row = 0, col = 0;
|
||||
int tile_c;
|
||||
int last_time, current_time, deltatime, score;
|
||||
|
||||
///////////////// SPRITE SHEET TOP LEFT COORDINATES /////////////////
|
||||
@@ -32,6 +24,8 @@ int spr_x[5][6] = {
|
||||
{288, 300, 312, 324, 336, 348}, // ball 2
|
||||
};
|
||||
|
||||
int spr_y[6] = {0, 11, 22, 33, 44, 55};
|
||||
|
||||
///////////////// RECTANGLE COORDS /////////////////
|
||||
SDL_Rect logo_src = { 384, 0, 78, 54 };
|
||||
SDL_Rect logo_dst = { 230, 136, 78, 54 };
|
||||
@@ -249,7 +243,11 @@ int game_logic(void) {
|
||||
while (research()) {
|
||||
eliminate_c();
|
||||
cascade();
|
||||
SDL_Delay(500);
|
||||
clear();
|
||||
//SDL_Delay(100);
|
||||
display_grid();
|
||||
SDL_RenderPresent (sr);
|
||||
}
|
||||
col = new_column();
|
||||
// next column preview here
|
||||
@@ -288,7 +286,7 @@ int Ren_game(void) {
|
||||
{
|
||||
current_time = SDL_GetTicks();
|
||||
deltatime = current_time - last_time;
|
||||
if (deltatime > 10) {
|
||||
if (deltatime > 500) {
|
||||
last_time = current_time;
|
||||
deltatime = 0;
|
||||
game_logic();
|
||||
|
||||
Reference in New Issue
Block a user