-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (28 loc) · 800 Bytes
/
main.cpp
File metadata and controls
35 lines (28 loc) · 800 Bytes
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
#include <allegro.h>
#include "acteurs.h"
using namespace std;
int main()
{
BITMAP* buffer = NULL;
BITMAP* perso[3] = {NULL,NULL,NULL};
allegro_init();
install_keyboard();
install_mouse();
set_color_depth(desktop_color_depth());
if(set_gfx_mode(GFX_AUTODETECT_WINDOWED, 800, 600, 0, 0))exit(EXIT_FAILURE);
show_mouse(screen);
buffer = create_bitmap(SCREEN_W,SCREEN_H);
perso[0] = load_bitmap("img/acteurs/perso1.bmp",NULL);
perso[1] = load_bitmap("img/acteurs/perso2.bmp",NULL);
perso[2] = load_bitmap("img/acteurs/perso3.bmp",NULL);
Personnage p1(10,10,1,perso);
while(!key[KEY_ESC])
{
p1.deplacement();
p1.afficher(buffer);
draw_sprite(screen,buffer,0,0);
clear_bitmap(buffer);
rest(50);
}
return 0;
}END_OF_MAIN();