-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
97 lines (92 loc) · 2.59 KB
/
main.c
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#include "prototypes.h"
#include "Online/socket.h"
int main()
{
lancerAllegro(1280, 1024);
lancer_Reseau();
BITMAP *fond=load_bitmap("image/menu/fondMenu.bmp",NULL);
BITMAP *buffer = create_bitmap(SCREEN_W, SCREEN_H);
BITMAP *image[37];
BITMAP *titre = load_bitmap("image/menu/titremenu.bmp",NULL);
t_classement tableau[20];
char chaine[100];
int sourisY = 355, y=0;
chaine[0] = '\0';
int compteur=0, sauvegarde, continuer = 1, tuto = 0, ecrire = 0, pos=0, clic=0;
float x=0;
chargementImageMenu(image);
sauvegarde = recupererNiveauUnlock();
int scene = 1;
int score;
int article = 36;
connexionReseau(3, NULL, 0);
while(!key[KEY_ESC] && continuer == 1)
{
clear_bitmap(buffer);
blit(fond,buffer,x,0,0,0,SCREEN_W, SCREEN_H);
x+=0.4;
if(x>3071)
{
blit(fond,buffer,x-4351,0,0,0,SCREEN_W, SCREEN_H);
}
if(x>=4351)
{
x=0;
}
if(scene == 1)
{
MenuPrincipale(buffer, image, &scene, &compteur, sauvegarde);
}
if(scene == 2)
{
NouvellePartie(buffer, image, &scene, &compteur, sauvegarde, &tuto,&ecrire, chaine, &pos, &clic, &score);
}
if(scene == 3)
{
ChargerUnePartie(buffer, image, &scene, &compteur, &sauvegarde, &score, chaine);
}
if(scene == 4)
{
leaderBoard(buffer, image, &scene, &compteur, tableau, &sourisY, &y);
}
if(scene == 5)
{
continuer = 0;
}
if(scene == 6)
{
envoieScoreServeur(buffer, image, &scene, &compteur, chaine, score);
}
if(scene == 7)
{
wiki(buffer, image, &scene, &compteur, &article);
}
textprintf_ex(buffer, font, 1190, 1010, makecol(255,255,255), -1, "online:%d", online);
if(online >0)
{
circlefill(buffer, 1263, 1013, 5,makecol(0,255,0));
}
else
{
circlefill(buffer, 1263, 1013, 5,makecol(255,0,0));
}
if(scene==4)
{
masked_blit(titre,buffer,0,0,140,3,SCREEN_W, SCREEN_H);
}
else if(scene!=7&&scene!=6)
{
masked_blit(titre,buffer,0,0,140,40,SCREEN_W, SCREEN_H);
}
blit(buffer, screen, 0,0,0,0,SCREEN_W, SCREEN_H);
}
connexionReseau(4, NULL, 0);
destroy_bitmap(fond);
destroy_bitmap(buffer);
destroy_bitmap(titre);
dechargementImage(image);
allegro_exit();
fermer_reseau();
return 0;
}
END_OF_MAIN();