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
| void jeu(BITMAP* buffer)
{
//Declaration des variables
BITMAP* background ;
int x, y;
long wSIZE, hSIZE;
char** Matrice; //Matrice contenant le niveau
int nbLignes, nbColonnes ;
nbLignes = nbColonnes = 0;
//Ouverture du niveau
int[2] nbLignesColonnes = ouvrirFichier("data/lvl/m01.txt", nbLignes, nbColonnes, Matrice);
nbLignes = nbLignesColonnes[0];
nbColonnes = nbLignesColonnes[1];
allegro_message("%d, %d", nbLignes, nbColonnes);
//Initialisation des variables
background = load_bitmap("data/img/background.bmp", NULL);
x = y = 0;
wSIZE = nbColonnes * 42;
hSIZE = nbLignes * 42 ;
//On initialise le buffer
buffer = create_bitmap(wSIZE, hSIZE);
while(!key[KEY_ESC])
{
clear_bitmap(buffer); //On efface l'écran
textout(buffer, font, "Scrolling avec les fleches", 10, 10, 0xFFFFFF);
blit(buffer, screen, x, y, 0, 0, SCREEN_W, SCREEN_H);
}
} |
Partager