From 84ce5efc73a1aa55ac4dd0b4d3bad6167363c3d9 Mon Sep 17 00:00:00 2001 From: zombie Date: Sat, 12 Feb 2022 09:42:41 -0500 Subject: [PATCH] fixed things idk --- a.out | Bin 19904 -> 19992 bytes playergame.c | 50 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/a.out b/a.out index 8ba520f07f90c7488c49666cbc99422a587debff..214744739878ef05734b2c050a2c7256dcb19e0e 100755 GIT binary patch delta 2080 zcmah}Z){Ul6u6m}CUeNY_3U|9{M6kaLi-kfKZ%D{ zIcp*(+0AxK8HbS6YQIRPopV+T@`zAuQ)*6 zUUAScnqfu_6VKAQai?x34RDGYZ7VIQa=}7`E?@v8rB}Q4FpJaXXpJqC-q+VEJyL7tA=nc1Z{?QSp@4~ja;=_x z@S$U30BW^pSP=(f`A}SU2V&V2?a@&uMX5Uw<6ugtO%2BZ3SQc~Kn;&W9(Z%Lqx2Z9 zT(`~GgA>AYbT-3V7&xu#A=#N(Asf24c-Xk!Cmyp>mlluD)S~RT&W=-dTxZAidBCNq z;VHF#5)OM}F+$3ZbkHwO!Eq-OO__kU0D8d>Z7K0FC7SzK;b0#i;K{6TblPwk;o#vJ z@92o(p(Y-Za8uRrO#tYA>f=zeDAnn&fAmhm!85=EhchUTL z$^25tf4jLC35SN@XqrgnVz+V?-i`g6)Adp5?}c^?D!{Ftl~jFvryh+ECY8$uB@Cw7yok9tzhg6QOk>WhyMSE}1GoXl>oXhf>R^MH3=NJQ?Z7{8^js z+)E^!W5#ddF@Fa8Kg%bzC~0T%N5~$3fwgWTk?4Yxc9Ty3&N)%|kWt9tJj|@Lo7r2e zEzN>p=ZIca2U(c=4DN~S$vtCZ%Ds`i!gm=a%91Y_uYIQpAr4^+q#=R)ROG=?@>|g| z>?GO6ieol>Fn?m#b3j_KmwZ`VgJWc@c!#452$nH#1Y$m}Brh-h1TQA8k|j>L-)NOR7DHuDkBSMe-d zD-54?tnfjvQmW)DxFBEauJ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U3&y#iNNS>?f{CGIjPcm@)LW`Toe=Jq1axwHc2ybz2fLL(m%TD;*329=hx%ylSS zp)*2Am{rl@WsI*5{~KhPmz8%_U@t;`FXo(r0J%VcSzTy=(#0`u_1R%+4^DMBQizza z*>ZsQn=SN_V7 delay) { - mvaddch(player.x, player.y, ' '); + player.xold = player.x; + player.yold = player.y; + enemy.xold = enemy.x; + enemy.yold = enemy.y; switch (getch()) { case 'a' : @@ -53,26 +58,13 @@ int main( int argc, char *argv[] ) { //yoinked from the internet argc is number gamerun = false; break; } - switch (dosspin) { - case 0 : - mvaddch(enemy.x, enemy.y, '-'); - break; - case 1 : - mvaddch(enemy.x, enemy.y, '/'); - break; - case 2 : - mvaddch(enemy.x, enemy.y, '|'); - break; - case 3 : - mvaddch(enemy.x, enemy.y, '\\'); - break; - } //game logic not kb dependent if ((enemy.x == player.x) && (enemy.y == player.y)){ endwin(); puts("you lose :("); return 0; //TODO fix this this should not be here... } + //TODO fix enemy movement (it works but its kinda broken) if ((clock() % 500) == 1) { if (enemy.x > player.x) { enemy.x--; @@ -83,14 +75,32 @@ int main( int argc, char *argv[] ) { //yoinked from the internet argc is number } prevtime = currenttime; } - mvaddch(player.x+1, player.y, '#'); //idk how to fix + //entity rendering + mvaddch(enemy.xold, enemy.yold, ' '); + switch (dosspin) { + case 0 : + mvaddch(enemy.x, enemy.y, '-'); + break; + case 1 : + mvaddch(enemy.x, enemy.y, '/'); + break; + case 2 : + mvaddch(enemy.x, enemy.y, '|'); + break; + case 3 : + mvaddch(enemy.x, enemy.y, '\\'); + break; + } + + mvaddch(player.xold, player.yold, ' '); + mvaddch(player.x, player.y, '#'); } //cleanup endwin(); - printf("Args %d",argc); + printf("Args %d",argc); //anti Wall Werror Wextra - puts(argv[0]); + puts(argv[0]);//anti Wall Werror Wextra return 0; }