From 03ca86f3098c71ab03a9b4fd45959d109158c6b1 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Sat, 12 Mar 2016 23:46:59 -0600 Subject: [PATCH] pdir printf(%c%d %c%d %c%d %c%dn, dirchar(0), inpu.Keyboard[def->up], dirchar(4), inpu.Keyboard[def->down], dirchar(1), inpu.Keyboard[def->left], dirchar(3), inpu.Keyboard[def->right]); --- src/inputest.c | 2 ++ src/lib/16_in.c | 16 +++++++++++----- src/lib/16_in.h | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/inputest.c b/src/inputest.c index 5e9297bc..c1a72ab2 100755 --- a/src/inputest.c +++ b/src/inputest.c @@ -38,6 +38,8 @@ main(int argc, char *argv[]) player[0].d=2; player[0].persist_aniframe=0; player[0].speed=4; + player[0].kd[0]=2; + player[0].kd[1]=2; while(!IN_KeyDown(sc_Escape)) { #define INC_PER_FRAME if(player[0].q&1) player[0].persist_aniframe++; if(player[0].persist_aniframe>4) player[0].persist_aniframe = 1; diff --git a/src/lib/16_in.c b/src/lib/16_in.c index 40705855..6415a29c 100755 --- a/src/lib/16_in.c +++ b/src/lib/16_in.c @@ -857,17 +857,23 @@ register KeyboardDef *def; if(DIRECTIONIFELSEGFXTEST) { // if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){ -// if(testcontrolnoisy > 0){ printf("ud "); printf("%u ", inpu.Keyboard[def->up]); printf("%u ", inpu.Keyboard[def->down]);} - if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]))// || player[pn].pdir != 4) + if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down])) + { my = motion_Up; - if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up]))// || player[pn].pdir != 0) + } + if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up])) + { my = motion_Down; + } // }else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){ -// if(testcontrolnoisy > 0){ printf("lr "); printf("%u ", inpu.Keyboard[def->left]); printf("%u ", inpu.Keyboard[def->right]); } - if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]))// || player[pn].pdir != 3) + if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right])) + { mx = motion_Left; + } if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left]))// || player[pn].pdir != 1) + { mx = motion_Right; + } } //input from player if (inpu.Keyboard[def->button0]) diff --git a/src/lib/16_in.h b/src/lib/16_in.h index 760b5bb2..183dbb24 100755 --- a/src/lib/16_in.h +++ b/src/lib/16_in.h @@ -229,6 +229,7 @@ typedef struct byte d; //direction to render sprite!! wwww byte q; //loop variable for anumation and locking the playing to compleate the animation cycle to prevent issues with misalignment www byte near pdir; //previous direction~ + //byte near kd[2]; //array of arrow key pressed word speed; //player speed! //0000 planar_buf_t huge *data; //supposively the sprite sheet data // planar_buf_t data; //supposively the sprite sheet data -- 2.39.5