Motion mx,my;\r
ControlType type;\r
sword conpee;\r
+ byte dir=DirTable[2];\r
register KeyboardDef *def;\r
\r
dx = dy = 0;\r
{\r
mx = motion_Right;\r
}\r
- }\r
+ }else{ //2 keys pressed\r
+ switch (player[pn].pdir)\r
+ {\r
+ case 0:\r
+ case 4:\r
+ if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right])) dir = DirTable[1];\r
+ else if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left])) dir = DirTable[3];\r
+ if(testcontrolnoisy > 0) printf("dir=%c ", dirchar(dir));\r
+ break;\r
+ case 1:\r
+ case 3:\r
+ if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down])) dir = DirTable[0];\r
+ else if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up])) dir = DirTable[4];\r
+ if(testcontrolnoisy > 0) printf("dir=%c ", dirchar(dir));\r
+ break;\r
+ default:\r
+ break;\r
+ }\r
+ if(testcontrolnoisy > 0) printf("pdir=%c ", dirchar(player[pn].pdir));\r
+ }\r
}\r
//input from player\r
if (inpu.Keyboard[def->button0])\r
player[pn].info.button2 = buttons & (1 << 2);\r
player[pn].info.button3 = buttons & (1 << 3);\r
// player[pn].info.dir = DirTable[((my + 1) * 3) + (mx + 1)];\r
- conpee=(((my + 1) * 2) + (mx + 1))-1; //if(conpee) conpee--;\r
+ conpee=(((my + 1) * 2) + (mx + 1))-1;\r
player[pn].info.dir = DirTable[conpee];\r
\r
//TODO: overwriting direction must be added\r
if(DirTable[conpee]!=2) player[pn].pdir=DirTable[conpee];\r
- if(player[pn].q==1 && (mx!=motion_None || my!=motion_None))\r
+ if(player[pn].q==1 &&( dir!=2 || (mx!=motion_None || my!=motion_None)))\r
{\r
- player[pn].d = player[pn].info.dir;\r
+ if(dir==2) player[pn].d = player[pn].info.dir;\r
+ else player[pn].d = DirTable[dir];\r
}\r
\r
#if DEMO0\r