Update main.c
This commit is contained in:
+8
-10
@@ -16,13 +16,14 @@
|
|||||||
#include "column.h"
|
#include "column.h"
|
||||||
#include "sdl.h"
|
#include "sdl.h"
|
||||||
#include "events.h"
|
#include "events.h"
|
||||||
|
#include "hiscore.h"
|
||||||
|
|
||||||
///////////////// MAIN MENU ////////////////////////////
|
///////////////// MAIN MENU ////////////////////////////
|
||||||
int menu(void) {
|
int menu(void) {
|
||||||
quit = false;
|
quit = false;
|
||||||
Ren_menu();
|
Ren_menu();
|
||||||
while (quit == false) {
|
while (quit == false) {
|
||||||
SDL_Delay(20);
|
// SDL_Delay(20);
|
||||||
SDL_PollEvent(&event);
|
SDL_PollEvent(&event);
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
case SDL_KEYDOWN:
|
case SDL_KEYDOWN:
|
||||||
@@ -47,10 +48,7 @@ int menu(void) {
|
|||||||
if (event.key.keysym.sym == SDLK_5) {speed = 3.0;}
|
if (event.key.keysym.sym == SDLK_5) {speed = 3.0;}
|
||||||
if (event.key.keysym.sym == SDLK_6) {speed = 3.5;}
|
if (event.key.keysym.sym == SDLK_6) {speed = 3.5;}
|
||||||
handle_events(); // game levels
|
handle_events(); // game levels
|
||||||
reset();
|
end_game();
|
||||||
Ren_restart();
|
|
||||||
check_key();
|
|
||||||
restart = false;
|
|
||||||
Ren_menu();
|
Ren_menu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,13 +61,13 @@ int main(void) {
|
|||||||
if (sodium_init() < 0) { // initialise sodium
|
if (sodium_init() < 0) { // initialise sodium
|
||||||
printf("error\n"); // -1 = failure
|
printf("error\n"); // -1 = failure
|
||||||
}
|
}
|
||||||
|
initSDL();
|
||||||
initSDL ();
|
|
||||||
init_gfx();
|
init_gfx();
|
||||||
research ();
|
next_brick();
|
||||||
eliminate_c ();
|
initial_brick();
|
||||||
|
col = new_column();
|
||||||
menu();
|
menu();
|
||||||
shutdownSDL ();
|
shutdownSDL();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user