From 96e3aba911e4294acd7695dec39e66e6fce68f39 Mon Sep 17 00:00:00 2001 From: nandotk Date: Mon, 24 Apr 2017 19:10:33 +0200 Subject: [PATCH] add last btn - wait for player - winner screen --- gfx/btn/2_player.png | Bin 0 -> 1561 bytes gfx/btn/2_player_b.png | Bin 0 -> 1267 bytes gfx/btn/3_player.png | Bin 0 -> 1457 bytes gfx/btn/3_player_b.png | Bin 0 -> 1214 bytes gfx/btn/4_player.png | Bin 0 -> 1361 bytes gfx/btn/4_player_b.png | Bin 0 -> 1153 bytes src/client.c | 41 ++++++++++++++++++++++++++++++++++ src/client.h | 4 ++++ src/config.c | 22 +++++++++--------- src/defs.h | 10 ++++++--- src/draw.c | 49 ++++++++++++++++++++++++++++++++++++++++- src/graphics.c | 6 +++++ src/main.c | 3 ++- 13 files changed, 119 insertions(+), 16 deletions(-) create mode 100644 gfx/btn/2_player.png create mode 100644 gfx/btn/2_player_b.png create mode 100644 gfx/btn/3_player.png create mode 100644 gfx/btn/3_player_b.png create mode 100644 gfx/btn/4_player.png create mode 100644 gfx/btn/4_player_b.png diff --git a/gfx/btn/2_player.png b/gfx/btn/2_player.png new file mode 100644 index 0000000000000000000000000000000000000000..8a247e03cc13a426c0e95b6b1b12d1b7db599d87 GIT binary patch literal 1561 zcmV+!2Il#RP)IY|jUP62N)g$ z7aaq4mlFvL0Rsd8OkoVP#Tb{s7?r*kv*a9> zzZf1S1UpL!HADz*ixCD00kYy8s@NN2eh)N42z;FrMp+9H6#`^{5T3~yXoL_lKnMf| z0EVj-hN=~&(;78H2#c^5Rcs9(Cj|ik06IwtrP3OEoD+JR6BZl;h^-ZNmJ+Yt99M1) z4-*0j3juA45u(l-6Bq*&8Urpn2ZyW`5f%bGObHw$1W;xSg{c*>;T&v=5pt3ejItIX zDg`e*2QfbfA1DQBg%Eg|6M32wcbF5Bxfg4Q5jRE%YKIYTjS+B;5s0o8UUv_!-5ZIn z7JZ)-u-_auMF?Sh4?t21O=1ic8v}fv6sXl2imw)|+Z#AX2tQE@PGby&s1-s~3KJOv zsn;8gvlb#N1%jm%GeHO#9|Nn|8$C@4X`6y900003bW%=J009CGW0bQ1000SaNLh0L z01FcU01FcV0GgZ_000B@Nkl%LRHi;kr4pcLF?vo8%8?hHFF*(M zY!sjaI-mnOpaXi=3D5x@&;cFL0X^%qQs}vUgZPD>w;|te5TDRDZc;b<4dM^_maVFs z=)rCJt2Zoq!S)dGa!#nQDAQd`y}J`GDMhHvXcjw#l@nnR+>Wr3s#;;uy|OCI8a<#F zL{&a|AydkZOgH=DQgzDcF3fDRkrfu*Yj{TY=sS0*7U;DJM_nFnYrFMkJqNv^BpQvD zG?3-H3nPt`Ma^`rlZ9;$YT9j`#N+tZ*yMIwS$M!SBt|PzCEkZJ0fa^?9sKu|1bIx z)tDe$pqEx>lG~v-A3b*5hzYGQdeE>1y`ozdY>%#;s8xl~JG)MvO2+UeH}iC2=v3Hg z!+3@?a&L1^SzMrZ_o$S3=&`fs&Zi@K`}#RW4d`=`cEJgq8#Xx9j@pL?N#n34nq@#k zeA%H7<5*_Y5y78}-I>rVitr#5&XAHWzylc0xBD9f&W}t?`Uj zVH)Y3GY;p-$e3joeT`Me)S=NCohP^XF)?%ta*?@+wNPH-(D8&Xabtq~WjN;)Ku6t2 z+@R}&Gh*#t4fI#~lh!;+KJ&izj*en)LgMI5g4IVy3%K>xxiX>0m&tc)3jIB9bo^xDcfG!$XO#dQ(4`Wf1G-cKbU>F%fDY(V3D5yuDgip6OC>-Dbg2aB zfG(8)9nhr`pv(FRUHu!nvZBlT&FIXJg-fJ>qR5J_$ct|L)dT+kXJit2Q&gop00000 LNkvXXu0mjfFY%I) literal 0 HcmV?d00001 diff --git a/gfx/btn/2_player_b.png b/gfx/btn/2_player_b.png new file mode 100644 index 0000000000000000000000000000000000000000..b1efc8f58dcbfe9b0511db191b4f14853beadfe8 GIT binary patch literal 1267 zcmai!=~EI20L5`V%A7LS3tNlIH6zR;k3vyL6Fk_}YSd7fyb5UmFA@+!XWg{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|nODt39o&W$5@-4l7Y3aox-tu&e8!;8zsL2ATw4 z9<+Uk@f2sYzo3trF)15B%n|)hF*Kj%sY=SFi4QY@D_f!lqX4iN!IN}2mNJ<%W}inF zecinwr_L>zA8GZlZd7o#_hTkrk#0*@$B(2K(j53kXA}BWegCxJ)^pN|&hy$~!;1kT M;8CFuLXr#r14#gDt^fc4 literal 0 HcmV?d00001 diff --git a/gfx/btn/3_player.png b/gfx/btn/3_player.png new file mode 100644 index 0000000000000000000000000000000000000000..fcc12a8b63ec8f41e4b729efe9daeca0cd2f7fca GIT binary patch literal 1457 zcmV;i1y1^jP)UwIFi!Wbzu z1_A>BEH?+9$r(CI2?7EDBP|7xw--1_2{}m#Jx&QhQVNc>79uPKqRtuz2>}TU0jAR$ zCNKsrI|mpZ0~Z|wMp+9>U*6(1-CHA4tALI`h-5wPGKt=t>5{$AIAu0uyzZiFz6L^^ulDQXciV%u8Z$u%@Az3_00003bW%=J009CGW0bQ1000Sa zNLh0L01FcU01FcV0GgZ_000BLNklFI%(_xsZ@^X|@k5ZHN;XN`~%G7JN06+$)) z9qHH{(v)sE!4Dd=N?ETZeM?ARddY2S6L zj{!Q+fev(_1HJA7bf5zr=s*X0-392C(j(Do1FA;fx~ zcJGN(KhBBo-RB-oFu&bNrkYH1KWQdZWzAGs3vRb~D-miH9NyNR^mYcMA4ntA(J2@_ z=vhjad)WKKr9)0-p%U_NIzUS?1*46Q#@&0;aXMn(XldpT)D4_%ITIrI#V`5I?vLb+>bfcEWzmKkSmia`gsw3 zid_3HsOa3X>6uw`c4nIHoU{DSGGz%CtDs*@yXhU5gy_rVozpyLQLgyh(%{i6p1yIW zGMAUk!ft70LrA}waf)uq=g<$^ufa=oZ^muaCvE@zg)@P%{_{kW^bYKn7=Y=pQ)e^ zvrp#}Io)DO^kz>CTh+H8{PT%r|zHEN-qVS0<)! zCXpb?O?Tb*Rp!gT)i(F=57L>S=CnV1o%H==%It3-ODSBbR|Lo6tg*BF8b|22a%EzA z=YTMxZz%t>)c-%8fDUw^10Co<*C#*+x>f-?(6tKCfv#164s@*obf9Y$paWg203GOB z1?WK6Dht^@!800000000000000000000000000000$m_ZHn zdkBa%ShM|pZPYLQo&=WDu+HfZ4fT5%SWa)q$mn2nyAAqYS7a)WEBa1%RJNW_=4fj) zuW8*cNt(1uCu&DK>WDU`Oh%c;f?^tF`Z%)p&H7REK{Z=-n=Z=8XijS*TmIl#5+kD% zm92dXYGia$l6sc8ZnVr1Ei07!V_r*oc<-lzYkGBRB>e;J&;RwVUXE(HPDtmfTMsj%e+=*OK(~-ZQmmP(Lq8`c%X=%~w{t-sfPF9v|~~;k!di_AN=d zk;{(QBnC zH!^y)cI>^;N#EIh`tRte+DQ+Oc3NAtLedIt)oEwVryXCUQhVRo_LsAwTlHUM(&uzb zLd3UAcbd)wE>!t(vZQ8uw8gf61=O4M#GESJ7Gmb&+nl+q6S_TY!Q+1;d(+x9=yj7` zPe}Se>8JMBgh-3#HLbnLt*gD|y{sF*1pnl@5SiLTJbyHB)RtU+%;pPxyLeOogH$<41bWj-url7@=il*R>LDf z_n>XH`iM<>Sgg>b$Bd==Z2b{Fk(Znex*@cf^g+!8C4JgEQ2R&9-YWx1m!wttH!pjz zku^*9d{D}bjGpsE%90nlnI#Ra)4!xkNAj}6jjUOs8-u>GEFOP)wrSEAx~U~?Vl3?@ z{mH!SOn#@Yw`PeB1*hD|w@p*5yV^Q4++xx@(b1YodfJZMYR%=PTN+rig3x`Pb^6`< zsow8`*6X}usn%7^}2#sbc%6(^xF`vOV07*qoM6N<$f`6G;6#xJL literal 0 HcmV?d00001 diff --git a/gfx/btn/4_player.png b/gfx/btn/4_player.png new file mode 100644 index 0000000000000000000000000000000000000000..a654817f9ebffe3f939d3a2f14830c115734b672 GIT binary patch literal 1361 zcmV-X1+MyuP)nwA%oz+20)L?tP-P6T-yAna z2s%m$Jx&QdO$h=503$60khd2&NC`Pf2|-c{jlMp+B3+#8p`7?r*kv*a8dBm|Yc7X=3ZY>E*)ObM#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Dk)n>}}U%vnvtMbGrBo(YW7T+#g}zs+djQzlbZJr_X-@Zzd#^XBi^?QrI@8twWtaECvZ7s{QSScB`xc|$mN8%6gEe!e z_dTW`^j<{7q~ueKW^XX|XwMm+cUybL&G5RqS=!F@{&Gjru#>`roEbwG@-q^X6<>%Qoz{J_l@?Ta2Gw(4ZRRl^zx<7w#y|wl;g&URNz`Mw<1 z&(?RF_vl4^(!yR#@;TnW(L<536CDUX)2F>Jo<4mJ7#G-sL)%X2O&!UX1!L`^-q8`g zvHHlQ7<1M;!`Jf{-LtDLdpu@sEzetZi(AEB^qxKlenW3cf{Sjuri2&WjAqYeo3VDA zHKzX)xwX;H<}D{0nzNd0MgP<5$g~SBx?e2cqKD*Cy|#XaujVZ`ylx0%Ec#a-zuKGF zfsIh~t@=A}dp>V5U+jJvJZCkP7rm>a4gDmf=zX8%ZO8NPX>^_qC@cE)!lR0MD0<&( z8r(9Int3*0xab%3K!fqyD|!+ft(l_x|By3H>So@$yQJr&(Q|uv(I;Z7BT4G&sE)OF zgf(iv&W$D0gPMyN_di|GtR!h#mxk7UuCMb?iC%7h7tAyLcRky9eD~j_%p*SaidDYc z)Ju+N_FSrSaQ_Lar%#>xGI(b3ha|thORe}$a{SM)FEpheqqnYdM*Y`>=PG+F8lTTQ zGPFsw*%57!OZh9y`N~Y~X38XNc}VYw%%P|?}5;! zjxsH`_h(zIM;)EzA2J)wG?#S%000000000000000000000000000000xNH3nB1{D; Tx9ZqV00000NkvXXu0mjf1HL>O literal 0 HcmV?d00001 diff --git a/src/client.c b/src/client.c index 67c9521..8d1ed7a 100644 --- a/src/client.c +++ b/src/client.c @@ -108,6 +108,37 @@ int get_response(int sock, t_game *g) return (0); } +void all_players_connected(t_game *g) +{ + int a = 0; + + for (int i = 0; i < MAX_PLAYER; ++i) { + if (g->player[i]->connected == 1) { + a++; + } + } + if (g->info->playermax == a) { + g->info->status = IN_CONFIG_NEW_GAME; + } +} + +int one_left(t_game *g) +{ + int a = 0; + + for (int i = 0; i < MAX_PLAYER; ++i) { + if (g->player[i]->connected == 1 && + g->player[i]->life > 0) { + a++; + } + } + if (a == 1) { + return (1); + } + + return (0); +} + void client_beer_bomber(t_game *game) { unsigned int frame_limit = SDL_GetTicks() + 16; @@ -130,10 +161,20 @@ void client_beer_bomber(t_game *game) send_request(server, game); get_response(server, game); draw(game); + if (one_left(game)) { + go = 1; + } + } else if (game->info->status == WAIT_FOR_PLAYER) { + go = get_input(game); + send_request(server, game); + get_response(server, game); + all_players_connected(game); + draw_wait_for_player(game); } delay(frame_limit); frame_limit = SDL_GetTicks() + 16; } + draw_winner(game); send_deco(server); clean_client(game); } diff --git a/src/client.h b/src/client.h index 014dd1c..a2fc7f5 100644 --- a/src/client.h +++ b/src/client.h @@ -11,6 +11,10 @@ int get_input(t_game *); void draw(t_game *); +void draw_wait_for_player(t_game *); + +void draw_winner(t_game *); + void load_all_sprites(t_game *); TTF_Font *loadFont(char *, int); diff --git a/src/config.c b/src/config.c index a8e5eb0..09281eb 100644 --- a/src/config.c +++ b/src/config.c @@ -12,7 +12,7 @@ void is_new_game(t_game *game, int *c) if (*c == 2) { game->info->status = IN_CONFIG_NB_PLAYER; } else { - game->info->status = IN_CONFIG_IP_SERVER; + game->info->status = WAIT_FOR_PLAYER; } } (*c < 2) ? *c = 2: 0; @@ -29,7 +29,7 @@ void choose_nb_player(t_game *game, int *nb) } else if (game->input->right) { *nb = 4; } else if (game->input->fire) { - game->info->status = IN_GAME; + game->info->status = WAIT_FOR_PLAYER; } draw_nb_player(game, *nb); } @@ -44,19 +44,19 @@ void draw_nb_player(t_game *game, int c) switch (c) { case 2: - drawBtn(game, 250, 380, BTN_NEWGAME); - drawBtn(game, 550, 380, BTN_NEWGAME_B); - drawBtn(game, 850, 380, BTN_JOINGAME_B); + drawBtn(game, 250, 380, BTN_2_PLAYER); + drawBtn(game, 550, 380, BTN_3_PLAYER_B); + drawBtn(game, 850, 380, BTN_4_PLAYER_B); break; case 3: - drawBtn(game, 250, 380, BTN_NEWGAME_B); - drawBtn(game, 550, 380, BTN_NEWGAME); - drawBtn(game, 850, 380, BTN_JOINGAME_B); + drawBtn(game, 250, 380, BTN_2_PLAYER_B); + drawBtn(game, 550, 380, BTN_3_PLAYER); + drawBtn(game, 850, 380, BTN_4_PLAYER_B); break; case 4: - drawBtn(game, 250, 380, BTN_NEWGAME_B); - drawBtn(game, 550, 380, BTN_NEWGAME_B); - drawBtn(game, 850, 380, BTN_JOINGAME); + drawBtn(game, 250, 380, BTN_2_PLAYER_B); + drawBtn(game, 550, 380, BTN_3_PLAYER_B); + drawBtn(game, 850, 380, BTN_4_PLAYER); break; default: break; diff --git a/src/defs.h b/src/defs.h index 15ddc33..67eba78 100644 --- a/src/defs.h +++ b/src/defs.h @@ -42,21 +42,24 @@ enum sprite PLAYER_FOUR_DOWN, PLAYER_FOUR_LEFT, PLAYER_FOUR_RIGHT, - BOMB_SPRITE, BOMB_SPRITE2, BOMB_SPRITE3, - MAP_SPRITE_BASE, MAP_SPRITE_BLOCK, MAP_SPRITE_BUSH, MAP_SPRITE_FIRE, - MAP_BACK_ONE, BTN_NEWGAME, BTN_NEWGAME_B, BTN_JOINGAME, BTN_JOINGAME_B, + BTN_2_PLAYER, + BTN_2_PLAYER_B, + BTN_3_PLAYER, + BTN_3_PLAYER_B, + BTN_4_PLAYER, + BTN_4_PLAYER_B, }; enum status @@ -65,6 +68,7 @@ enum status IN_CONFIG_NEW_GAME, IN_CONFIG_NB_PLAYER, IN_CONFIG_IP_SERVER, + WAIT_FOR_PLAYER, IN_GAME, END_GAME, }; diff --git a/src/draw.c b/src/draw.c index 740b73b..3738c14 100644 --- a/src/draw.c +++ b/src/draw.c @@ -7,7 +7,7 @@ void draw(t_game *g) /* Blank the screen and draw background */ SDL_RenderClear(g->renderer); draw_background(g, MAP_BACK_ONE); - /* Draw the score */ + /* Draw stats */ for (int i = 0; i < MAX_PLAYER; ++i) { sprintf(text, "PLAYER %d", i + 1); draw_log_string(g, text, 50, 20 + (i * 150), g->font); @@ -41,3 +41,50 @@ void delay(unsigned int frame_limit) else SDL_Delay(frame_limit - ticks); } + +void draw_wait_for_player(t_game *g) +{ + char text[20]; + + /* Blank the screen and draw background */ + SDL_RenderClear(g->renderer); + draw_background(g, MAP_BACK_ONE); + /* Draw co info */ + sprintf(text, "WAIT FOR PLAYER ..."); + drawString(g, text, 50, 100, g->font, 1, 0); + for (int i = 0; i < MAX_PLAYER; ++i) { + if (g->player[i]->connected == 1) { + sprintf(text, "PLAYER %d CO !", i + 1); + drawString(g, text, 50, 150 + (i * 150), g->font, 1, 0); + } + } + /* Update the buffer */ + SDL_RenderPresent(g->renderer); + /* Sleep briefly for better perf */ + SDL_Delay(1); +} + +void draw_winner(t_game *g) +{ + char text[50]; + + /* Blank the screen and draw background */ + SDL_RenderClear(g->renderer); + draw_background(g, MAP_BACK_ONE); + /* Draw winner info */ + sprintf(text, "AND THE WINNER IS ..."); + drawString(g, text, 50, 100, g->font, 1, 0); + for (int i = 0; i < MAX_PLAYER; ++i) { + if (g->player[i]->connected == 1 && + g->player[i]->life > 0) { + sprintf(text, "PLAYER %d !!!", i + 1); + drawString(g, text, 50, 150, g->font, 1, 0); + } + } + sprintf(text, "DISCONNECT FROM SERVER IN 3 SEC ..."); + drawString(g, text, 50, 300, g->font, 1, 0); + /* Update the buffer */ + SDL_RenderPresent(g->renderer); + /* Sleep briefly for better perf */ + SDL_Delay(5000); +} diff --git a/src/graphics.c b/src/graphics.c index 3715cca..068dc02 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -114,6 +114,12 @@ void load_all_sprites(t_game *game) loadSprite(game, BTN_NEWGAME_B, "gfx/btn/newgame_b.png"); loadSprite(game, BTN_JOINGAME, "gfx/btn/joingame.png"); loadSprite(game, BTN_JOINGAME_B, "gfx/btn/joingame_b.png"); + loadSprite(game, BTN_2_PLAYER, "gfx/btn/2_player.png"); + loadSprite(game, BTN_3_PLAYER, "gfx/btn/3_player.png"); + loadSprite(game, BTN_4_PLAYER, "gfx/btn/4_player.png"); + loadSprite(game, BTN_2_PLAYER_B, "gfx/btn/2_player_b.png"); + loadSprite(game, BTN_3_PLAYER_B, "gfx/btn/3_player_b.png"); + loadSprite(game, BTN_4_PLAYER_B, "gfx/btn/4_player_b.png"); } void draw_background(t_game *game, int index) diff --git a/src/main.c b/src/main.c index 450c4ee..b301909 100644 --- a/src/main.c +++ b/src/main.c @@ -24,7 +24,8 @@ int main(void) go = get_input(game); choose_nb_player(game, &nb_player); } else if (game->info->status == IN_GAME || - game->info->status == IN_CONFIG_IP_SERVER){ + game->info->status == IN_CONFIG_IP_SERVER || + game->info->status == WAIT_FOR_PLAYER){ go = 1; } delay(frame_limit);