changement organisation
This commit is contained in:
43
script/main.c
Normal file
43
script/main.c
Normal file
@@ -0,0 +1,43 @@
|
||||
#include "../include/display.h"
|
||||
#include "../include/function.h"
|
||||
#include "../include/read.h"
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_image.h>
|
||||
#include <SDL2/SDL_render.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define SIZE_PLAY 19
|
||||
#define SIZE_MENU 200;
|
||||
|
||||
int main ()
|
||||
{
|
||||
dis display_user;
|
||||
display_user.size_menu = SIZE_MENU;
|
||||
display_user.size_box = SIZE_PLAY;
|
||||
display_user.size_window = getMaxSize (display_user);
|
||||
initSDL (&display_user);
|
||||
|
||||
vect *playerPos = (vect *)malloc (sizeof (vect));
|
||||
vect *targets;
|
||||
int nbr_targets;
|
||||
score playerScore;
|
||||
char **tab2d = creatArea2D (SIZE_PLAY);
|
||||
|
||||
score score_user = {0, 0, 0,0};
|
||||
|
||||
|
||||
targets
|
||||
= fileToTab2D ("test.txt", tab2d, SIZE_PLAY, playerPos, &nbr_targets);
|
||||
screenDisplayGameSDL (tab2d, &display_user);
|
||||
screenDisplay (tab2d, SIZE_PLAY);
|
||||
inGameLoop (tab2d, SIZE_PLAY, playerPos, targets, nbr_targets,
|
||||
&display_user, &score_user);
|
||||
|
||||
SDL_DestroyWindow (display_user.window);
|
||||
SDL_DestroyRenderer (display_user.renderer);
|
||||
free2D (tab2d, SIZE_PLAY);
|
||||
free (playerPos);
|
||||
free (targets);
|
||||
SDL_Quit ();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user