From 47b8bfa25a9681a1dafc7723685fabbe33747c5e Mon Sep 17 00:00:00 2001 From: SlyVTT Date: Wed, 16 Aug 2023 19:25:24 +0200 Subject: [PATCH] implementing the basis of player action --- CMakeLists.txt | 8 ++++++++ assets-cg/INFO_Icon.png | Bin 0 -> 4932 bytes assets-cg/NPC_Icon.png | Bin 0 -> 4809 bytes assets-cg/SGN_Icon.png | Bin 0 -> 4819 bytes assets-cg/SignAction.png | Bin 0 -> 5020 bytes assets-cg/fxconv-metadata.txt | 16 ++++++++++++++++ assets-fx/INFO_Icon.png | Bin 0 -> 4961 bytes assets-fx/NPC_Icon.png | Bin 0 -> 4923 bytes assets-fx/SGN_Icon.png | Bin 0 -> 4912 bytes assets-fx/SignAction.png | Bin 0 -> 4952 bytes assets-fx/fxconv-metadata.txt | 15 +++++++++++++++ src/game.c | 31 +++++++++++++++++++++++++++++++ src/game.h | 19 ++++++++++++++----- src/main.c | 5 ++--- src/player.c | 28 +++++++++++++++++++++++++++- 15 files changed, 113 insertions(+), 9 deletions(-) create mode 100644 assets-cg/INFO_Icon.png create mode 100644 assets-cg/NPC_Icon.png create mode 100644 assets-cg/SGN_Icon.png create mode 100644 assets-cg/SignAction.png create mode 100644 assets-fx/INFO_Icon.png create mode 100644 assets-fx/NPC_Icon.png create mode 100644 assets-fx/SGN_Icon.png create mode 100644 assets-fx/SignAction.png diff --git a/CMakeLists.txt b/CMakeLists.txt index df83849..6a7f080 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,10 @@ set(ASSETS set(ASSETS_cg assets-cg/demo_player.png assets-cg/demo_PNJ.png + assets-cg/SignAction.png + assets-cg/NPC_Icon.png + assets-cg/SGN_Icon.png + assets-cg/INFO_Icon.png assets-cg/player_face.png assets-cg/font.png ) @@ -55,6 +59,10 @@ set(ASSETS_cg_EGA64 set(ASSETS_fx assets-fx/demo_player.png assets-fx/demo_PNJ.png + assets-fx/SignAction.png + assets-fx/NPC_Icon.png + assets-fx/SGN_Icon.png + assets-fx/INFO_Icon.png assets-fx/player_face.png assets-fx/font.png # ... diff --git a/assets-cg/INFO_Icon.png b/assets-cg/INFO_Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f07aa4e740ac876a67f86b1f04e5df0ec27c07c5 GIT binary patch literal 4932 zcmeHKc~n#95)X$%?*i=h2&!5z9EX%qCua^ zVpJNj3MzuuNENLjZipg2YZWceS}THeK`m9}eF>;|UjOl&*Z<5pcl&1MH#5JPZ%)1( zar}e<1RnwphZ`V_M6FIESEi#xY`zvHqDG}0 zhco`%wq=&7)!%j1-RXjVr3mpk_fwYaJ+yLsxN}^{_f-$VuxFe0W;0TjyG4z@!ra;Q z;sJgsaq>&gUHK)24a+_Cmu6mha&IEK89Os&zo%j79dm2*Y10v2}t3xDQ)_M3+if0bL+IGQGrh%^{-g- zw)N$$D&GYndM?f2%N4Ipcb0{De7mE0tkA>B^ecMx;)xpf4d(w~C9b(KcgNmw=1sQF zXs_V?(6IK0)#oN{xHhXx;r1Pwv^&UNNW5_=qL&w*o!tJZB?m=e9x zdT4y{x{Tk(<;^MF<}^GuXaoA4%R#Y&Nz3!Mb9z@nwQYdh7$Oz z@0PEabBXzr7BLlkk-Z$hexziU!;)Wbu&e}p%h%6BNyC=&s5waw%>@x&ic=AS#YK^a zj`VXU#g%EZ9UUXq^8>EJmtwLaAl#6nmpwWh9TM+5eaR)nZ!CXa=wtRS+ga+WUp8{f zu-H9g=m$?t?_26UleA%z$ud8{Yw)^Ljizl@G>|fC7SC#3 z_|n96p@`}NX1pxa2W+i~u>SIBg@dJV(S>0N15%;3cBa`PechORc=z1vY5Of1dD*Xv zE%Le)RywJgr;M!ZeKh(b+|{&2&my;vtO<*=~nXHXU>g^qKic73b#mxc;p6ZO z7ccYCr`2B!^*`oz{}pB5z|*lNas=b3*9cbLq$&8QRo;QgMGa$Wq#n_x#6^AY@<;DpN&J)Wm~i=RFvQtf zGkjoIZF6B)b?}u#c{K7+gKyp5A73myeX)6S(~{!T`6q%FM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CKumip879$(` z&JS$4=V#7tO8?HEG=6D>Y3sE8Gp#yHMQGWfO3N_oeK*0YG)0~?EdZ1VClti<_eZ6y F_%9ykU&#Of literal 0 HcmV?d00001 diff --git a/assets-cg/NPC_Icon.png b/assets-cg/NPC_Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..60597e53d4f57bc5444b58ca036b7129be2bc573 GIT binary patch literal 4809 zcmeHKc~lcu7atZ85Q_?eJ0VgkaweH9WD`UnDF%$B5H?$sNiu;5Sx5$mfJ;RwP(P$p zK@jAKAfgq;6+}b@1;vG8g;EPjajRBT+-fWGy#!P^U;pu(um6#p$;`ZW@9*CGd%t&2 zUWRa~??lTPmJkF@Bnra=(L{n;qms#EF#^6yjS(=N zTn0h9UmoQ}9D3$#mG(HCmlw%5&$tu0Ms^~VRDU40X&|TYG4WAwl(FQrckYHcgnOm0 zJBnQgzV^QEe{tpVl`b>=Dr+&2#M0t|ys1`l>x-?~McgKi})z+~oHr zC6L}(+^{B@DOJsTWB$xGXX5_msp}f&@@JT3<(4k`u5`{6ujIXL`Ps$&cwT0D`$^$R zSC21he4ih7uWP%QQqk<6)6z9KFQAlcqxrk1e4w`@z4(rEdBu@BsppQPX$K^i!+0&@ zDo7nAeLtLok`{cmAtvBpD5GH)g8J^?lNHfbHT8V^@!3a%J~gZ4<(s)Jqi;SHRvK* z&8G(_7Z3LA%3{dHu9w~8bLH2fiWKNRnD0uCz&iVbLu)G{!frko|I_`F^W!UoN4C!> zm08=^c4U~*px!MOjqs#MA1!jDP;-}Hf9Y7}!+VCu9Vac=dV4 z`R5i_Kdt{X&$#QG+ubz-Tt(wmp=WwgIg)e2VyVO3a^_1r&ji)#zq%UB2Rd3ueg~Ud z&pKE?U2*GXY<_tT#+FRJ3%nx6BTMXk1* zMgQJE*xY;LG}o}AHm7sqDLy%YDJD0$4!ctce_HlgUU|#pu(q9>`N?2YPvKxav-QyT z2yCC|czN&H7s(ARJzKlh>}n`D#YpxFyX$fF;WgdD6;+!~;r|J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!O--TOM-BFIe(VJnfxm)C(*51?UUw7qj z+_?5xQ3V-Ucqx@`q-A0e$dV?Acb*gt+x jJAYr^7xcVovSG;bN6Xgm_uVK5ijhP?p@B#JW7ho+DOw?7 literal 0 HcmV?d00001 diff --git a/assets-cg/SignAction.png b/assets-cg/SignAction.png new file mode 100644 index 0000000000000000000000000000000000000000..891b8247502bf40d0638262ae5068bae019818fb GIT binary patch literal 5020 zcmeHLc~lc=5|6?Nf{ucS2sp%`AnSC}xs#UQV!}-%VpK#9JKY_KE}k=@BBCPVHR8?l8U#gWMDYanOF)IU^N(+L_Am2ZC*5CF{i^C$^;Pm^ ziELuXKnHgR3WYK-EL0K=J_lPadt2~c{+8cNq1Y@=m&cINsEMjK=#(loK_%zt2`XV$ zDJc~5jnZ{!UOsieqRvJaQC8S@-{0SIy7fgr(Y*0j%Gmq%@5E3$c+sc_U&ZBRwyR&* z1jRTnOx|P&w+TNzGUE8L#pP>?9*+FBr49D)$1vPTw3jSRs1J$S*dab&xokAut;$y% zpkbVQoV;q9 z3Z~{tgBn)lw{^%SdghdTTax+QbFRmkot{-!v+wL}$Sj?rtH~={>g*g{us=w&ZtwCf z{1ZW@mhUe(t9_n~3~5LSPJPnc|4K7F(7XBMhOZ8~+wF=w_{YyLhD6yjPe&@;vLm-H zyYTC%nr#J%kJfHnuPoi-hd|dBoc+d;p>2gP-mATPh$UZ$E@wV86zv=m`#5C&oZm&$ zvLm+ndZ47?mxb=x`kSlVf3zLnoY53F)E28VjHeA>GGf{g?7?{ceEOE5OP$)&m5Pwc0b{l1p@?-}L4m70mL#yFwc_%-Dag`FNo( z-&B{d7q2QBZalkA)EMV5*ENQ|K7Nbr?3lup=yJ~Xi@{#4F+S?eevz}oS4#sPmdHzD zXJ=lKm!{X2pYzAY)}kwod73t1T@kvITjUz6E}7oCZpQTzO-#iV$1CPSAIFki$>X@8 zwcq$0O!O^d+rU2^qiRR=;r)wLE->0(I+LmtpL$t5X)yle+}}(Js+)4%wb#d2;-hbz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Sj*_i< zox#Gl3MdX-K3LngX%w=<1y2-EVx%&1sL_m(SyUF44vDPVWSA06A_tjOYJQ|}W)B3o z6HwxD+{CBRQc_Z=DNL%-tf4Uw1fkJk8Vp0g1G1zVaMTJJEdF+gZVVx2QJS?TTx&Ft z?U<;-n1l-`6ksR6%TI5TO5ej9EIlj$K4@0dL}O6tG`*hIJHmpCk^x9hLVp@zk%N&- zi^MF(B(o9|C1VEMzc++R`99v1WY#&#Q7LJd4$}iy3pkb0=g2ULRQ5i?PJu?NH#wpJ z*?l~5t@;C5eR8u~9Od**1cblG?c@Efc84?Yl1lkPqcX{!o2ArOzwWkXCB2SzX!iokS6FNn|0TA)f)*E=galnOwx6$&m(iSQsUL&bww9Fz;8 zOcoD(sOU-_#&bZal>C`SvmOQQ)ap?UMl%^S4uhR=euzvWpukl6haH&?#nm7{ zK$)#IBw0Tg1+SZwnt31BgZK zIt2g@SWpW;)Qq9H(JVI_bpnb#C9*xzA#ZX}cT>b#3-Cy_E51kbQP`61yY5For*)Xf zWQT0|sIvPI3!03n90!58Zj&+|HE1yKeD?_I-M;ounx$kT3^m4LKnxa#4zW-c0--#Z z1#wZ7j)GQkI0|K7bc<1qr=VsmL<1@X)c^rGsv%EyP#M_QJ0%{o^F)W45S<4xIC2KU zr!)9WcnTfn)9Do2r!P^Z#e+dB`f&Rfl*r>V z*nLY3qS*)6yQT)w{;%!b4!tHFpr(5dOi(b8Y40a;4`+6ze8Nu;C7wUApTndA!ML#t@r8Y!~u_1f9>s+8fRqx)E@opp8E+rvmrK5 z7w{TA_%}sKxTq}=<(BUsE*Q)*>bTk=#0f*{Q*VNCn^8{ literal 0 HcmV?d00001 diff --git a/assets-fx/SignAction.png b/assets-fx/SignAction.png new file mode 100644 index 0000000000000000000000000000000000000000..ced6850a6fcd9b3086c6cf4db8b44cbc8d98eb5a GIT binary patch literal 4952 zcmeHKX;c$g7LK%ofTFe_D(D!)qKK7LDwU9w1jPV?8qJAOux-#vRV4(;ViHIMS8Q#t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|4F&J?TL0O;xI8z01D2|+iayfhm;UX}E%H;|GL2x0qf~W9B z5d}e^+#V1!^eUiAJf>$>7AO)xp$dY{ms2Ff<*-o*C145?pg00ia+Hno@Hl;TJC0a1qFq6}TYiSDxiUGvp7M%hBs|TnB6X_}3sMX7~ z+880jk`mqGX_YtKud68`Dg&@sWKn##=4Vn1yPmp^K#a<|MW7a@5H6yn2j5-_X)ooB-&LaQu0Cu8$5HU~rgr$j%NWpKS~svqnB z+TLZ*W6}X?y4Ju11p}G&ej;~s2J-!!pKiH*&Jc9^mmr_S?-#nh(Dg|Se3J1Ob$y}h zlNk6U<1gy^%jk0W@J>f*z#lymcw^iDYU~8?wr3-sIysO=D@buiz>~c$WR8JG>+58> zdeJhohl0gE#!zukpSyMg2RaTW_T~)&OPtWa0GZuo^%-{mqwqkR%F518j`yRD*<)_+ yvytXa6pa;*%Z#EDs`b6RlJ*uK>~!n6;a@V#xsPX+Qw(sYg$7Lz{Atqs#6JMqeL%wi literal 0 HcmV?d00001 diff --git a/assets-fx/fxconv-metadata.txt b/assets-fx/fxconv-metadata.txt index 0ca3da4..499f659 100644 --- a/assets-fx/fxconv-metadata.txt +++ b/assets-fx/fxconv-metadata.txt @@ -10,6 +10,21 @@ player_face.png: type: bopti-image name: player_face_img +SignAction.png: + type: bopti-image + name: SignAction_img + +INFO_Icon.png: + type: bopti-image + name: INFO_Icon_img + +NPC_Icon.png: + type: bopti-image + name: NPC_Icon_img + +SGN_Icon.png: + type: bopti-image + name: SGN_Icon_img font.png: name: fontRPG diff --git a/src/game.c b/src/game.c index 284ce7c..2a6439a 100644 --- a/src/game.c +++ b/src/game.c @@ -6,13 +6,40 @@ #include #include +#include +#include "stdlib.h" + +extern bopti_image_t SignAction_img; void game_logic(Game *game) { + for( int i=0; imap_level->nbextradata; i++ ) + { + if ( (abs((int) game->player.x - (int) game->map_level->extradata[i].x*PXSIZE) < 8*PXSIZE) + && (abs((int) game->player.y - (int) game->map_level->extradata[i].y*PXSIZE) < 8*PXSIZE)) + { + game->player.canDoSomething = true; + game->player.whichAction = i; + return; + } + } + + game->player.canDoSomething = false; + game->player.whichAction = -1; + return; +} +void render_indicator(Game *game) +{ + if (game->player.canDoSomething==false) + return; + + dimage(5, 5, &SignAction_img); + //dprint( 20, 20, C_RED, "X= %d - Y= %d / Xp= %d - Yp= %d", game->player.x, game->player.y, game->map_level->extradata[0].x*PXSIZE, game->map_level->extradata[0].y*PXSIZE ); + //dprint( 20, 40, C_RED, "ABS1= %d - ABS2= %d", abs((int) game->player.x - (int) game->map_level->extradata[0].x*PXSIZE), abs((int) game->player.y - (int) game->map_level->extradata[0].y*PXSIZE) ); } void draw(Game *game) { @@ -20,6 +47,7 @@ void draw(Game *game) { render_map_by_layer(game, BACKGROUND); player_draw(game); render_map_by_layer(game, FOREGROUND); + render_indicator( game ); } /* Key management */ @@ -51,6 +79,9 @@ void get_inputs(Game *game) { if(keydown(KEY_F2)) { game->debug_player = !game->debug_player; } + if(keydown(KEY_F3)) { + game->debug_extra = !game->debug_extra; + } #endif diff --git a/src/game.h b/src/game.h index af724b5..76c6a38 100644 --- a/src/game.h +++ b/src/game.h @@ -1,6 +1,7 @@ #ifndef GAME_H #define GAME_H + #include #include @@ -24,12 +25,16 @@ typedef enum { /* Struct that define player parameters */ typedef struct { - int x, y; /* The position of the player int the current map */ - unsigned int px, py; /* The position of the player on screen */ - int wx, wy; /* position of the player in the world */ - unsigned short int life; /* How many lives the player still has between 0 + int16_t x, y; /* The position of the player int the current map */ + uint16_t px, py; /* The position of the player on screen */ + int16_t wx, wy; /* position of the player in the world */ + int16_t life; /* How many lives the player still has between 0 * and 100. */ - char speed; /* The speed of the movement of the player. */ + int8_t speed; /* The speed of the movement of the player. */ + + bool canDoSomething; /* set to true if a action can be done in the current position of the map */ + int32_t whichAction; /* indicates which data are relevant to the current action in the extradata layer of the map */ + bool isDoingAction; } Player; @@ -103,6 +108,10 @@ void game_logic(Game *game); /* Draws everything on screen. */ void draw(Game *game); +/* This render a small sign on the upper lecft corner of the screen */ +/* if the player can do an action */ +void render_indicator(Game *game); + /* Handle key presses. */ void get_inputs(Game *game); diff --git a/src/main.c b/src/main.c index 07d98d8..f7893c9 100644 --- a/src/main.c +++ b/src/main.c @@ -32,11 +32,11 @@ extern Map *worldRPG[]; /* Game data (defined in "game.h")*/ Game game = { NULL, - {12*PXSIZE, 36*PXSIZE, 0, 0, 10*PXSIZE, 48*PXSIZE, 100, SPEED}, + {12*PXSIZE, 36*PXSIZE, 0, 0, 10*PXSIZE, 48*PXSIZE, 100, SPEED, false, 0, false}, false, false, false, 0 /* debug variables*/ - , false, false, true + , false, false, false }; /* screen capture management code */ @@ -142,7 +142,6 @@ int main(void) { if (game.debug_extra) { dfont( NULL ); - //drect( 155, 80, 390, 150, C_WHITE ); for (int i=0; inbextradata; i++ ) dprint( 10, 90+i*15, C_RED, "X= %d - Y= %d - T: %s", game.map_level->extradata[i].x, game.map_level->extradata[i].y, game.map_level->extradata[i].dialog ); } diff --git a/src/player.c b/src/player.c index 3cb1efc..777a6b4 100644 --- a/src/player.c +++ b/src/player.c @@ -1,4 +1,5 @@ #include "player.h" +#include "dialogs.h" #include "map.h" #include "config.h" #include @@ -25,6 +26,9 @@ const char damage_taken_walkable[WALKABLE_TILE_MAX] = { }; extern bopti_image_t demo_player_img; +extern bopti_image_t NPC_Icon_img; +extern bopti_image_t SGN_Icon_img; +extern bopti_image_t INFO_Icon_img; void player_draw(Game *game) { @@ -77,8 +81,30 @@ void player_move(Game *game, Direction direction) { player->wy = game->map_level->ymin * PXSIZE + player->y; } + void player_action(Game *game) { - /* TODO */ + if( game->player.isDoingAction ) return; /* alreday doing something */ + + if( game->player.canDoSomething ) /* we can do something */ + { + game->player.isDoingAction = true; + + char *text = game->map_level->extradata[game->player.whichAction].dialog; + bopti_image_t *face; + + if (strcmp("PST", game->map_level->extradata[game->player.whichAction].type)==0) + face = &INFO_Icon_img; + else if (strcmp("NPC", game->map_level->extradata[game->player.whichAction].type)==0) + face = &NPC_Icon_img; + else if (strcmp("SGN", game->map_level->extradata[game->player.whichAction].type)==0) + face = &NPC_Icon_img; + else face = &demo_player_img; + + showtext_dialog( game, + face, + text, + true, true ); + } } bool player_collision(Game *game, Direction direction,