Update main.c

This commit is contained in:
Jason Bou-Samra
2024-09-28 09:46:53 +10:00
committed by GitHub
parent 77e7318eca
commit f22a207dd4
+6 -8
View File
@@ -16,13 +16,14 @@
#include "column.h"
#include "sdl.h"
#include "events.h"
#include "hiscore.h"
///////////////// MAIN MENU ////////////////////////////
int menu(void) {
quit = false;
Ren_menu();
while (quit == false) {
SDL_Delay(20);
// SDL_Delay(20);
SDL_PollEvent(&event);
switch (event.type) {
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_6) {speed = 3.5;}
handle_events(); // game levels
reset();
Ren_restart();
check_key();
restart = false;
end_game();
Ren_menu();
}
}
@@ -63,11 +61,11 @@ int main(void) {
if (sodium_init() < 0) { // initialise sodium
printf("error\n"); // -1 = failure
}
initSDL();
init_gfx();
research ();
eliminate_c ();
next_brick();
initial_brick();
col = new_column();
menu();
shutdownSDL();
return 0;