1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| #include "ai.h"
#include "collision.h"
#include "deplacements.h"
#include "particules.h"
#define TEMPS_TIR 100
#define HAUTEUR_ECRAN 700
#define LARGEUR_ECRAN 1000
void ai (AABB joueur, AABB ecran);
int main(int argc, char *argv[])
{
Input in; //variable perso
AABB ecran,
zone,
joueur,
bloc,
tirHor,
tirVer;
//déclaration des autres variables
//création des surfaces et initialisations des positions avec la SDL
memset(&in,0,sizeof(in));
while(!in.key[SDLK_ESCAPE])//in.key ===> tableau in, key[numéro de la touche enfoncée]
{
SDL_FillRect (ecran.surface, NULL, SDL_MapRGB(ecran.surface->format, 20, 50, 120));
SDL_BlitSurface (zone.surface, NULL, ecran.surface, &zone.pos);
SDL_BlitSurface (bloc.surface, NULL, ecran.surface, &bloc.pos);
SDL_BlitSurface (joueur.surface, NULL, ecran.surface, &joueur.pos);
ai(joueur, ecran);
//déplacements et autres fonctions secondaires
SDL_Flip(ecran.surface);
}
SDL_FreeSurface(bloc.surface);
SDL_FreeSurface(joueur.surface);
SDL_Quit ();
return EXIT_SUCCESS;
} |
Partager