else if (Keyboard[def->downright])\r
mx = motion_Right,my = motion_Down;*/\r
\r
- if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){\r
- if (inpu.Keyboard[def->up])\r
+ //if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){
+ \r
+ if((inpu.Keyboard[def->up] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 0)\r
my = motion_Up;\r
- else if (inpu.Keyboard[def->down])\r
+ else if((inpu.Keyboard[def->down] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 4)\r
my = motion_Down;\r
\r
- }else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){\r
- if (inpu.Keyboard[def->left])\r
+ //}else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){\r
+ if((inpu.Keyboard[def->left] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 1)\r
mx = motion_Left;\r
- else if (inpu.Keyboard[def->right])\r
+ else if((inpu.Keyboard[def->right] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 3)\r
mx = motion_Right;\r
- }\r
+ //}\r
if (inpu.Keyboard[def->button0])\r
buttons += 1 << 0;\r
if (inpu.Keyboard[def->button1])\r
typedef struct
{
+ int x; //player exact position on the viewable map
+ int y; //player exact position on the viewable map
+ int tx; //player tile position on the viewable map
+ int ty; //player tile position on the viewable map
+ int triggerx; //player's trigger box tile position on the viewable map
+ int triggery; //player's trigger box tile position on the viewable map
+ int setx; //NOT USED YET! player sprite sheet set on the image x
+ int sety; //NOT USED YET! player sprite sheet set on the image y
+ word q; //loop variable
+// word d; //direction
+ //bitmap_t data; //supposively the sprite sheet data
+ int hp; //hitpoints of the player
CursorInfo info;
ControlType Controls;
} player_t;
scroll16 library~
*/
#include "src/lib/scroll16.h"
+
+/*void animatePlayer(player_t *player,word playnum, short scrolloffsetswitch, int ls, bitmap_t *bmp)
+{
+ sword dire=32; //direction
+ sword qq; //scroll offset
+
+ if(scrolloffsetswitch==0) qq = 0;
+ else qq = ((player[playnum]->p)*player[playnum]->speed);
+ switch (player[playnum]->dir)
+ {
+ case 0:
+ //up
+ dire*=player[playnum]->dir;
+ player[playnum]->x=player[playnum]->x-4;
+ player[playnum]->y=player[playnum]->y-qq-TILEWH;
+ break;
+ case 1:
+ // right
+ dire*=(player[playnum]->dir-2);
+ player[playnum]->x=player[playnum]->x+qq-4;
+ player[playnum]->y=player[playnum]->y-TILEWH;
+ break;
+ case 2:
+ break;
+ case 3:
+ //down
+ dire*=(player[playnum]->dir-2)
+ player[playnum]->x=player[playnum]->x-4;
+ player[playnum]->y=player[playnum]->y+qq-TILEWH;
+ break;
+ case 4:
+ //left
+ dire*=(player[playnum]->dir+2)
+ player[playnum]->x=player[playnum]->x-qq-4;
+ player[playnum]->y=player[playnum]->y-TILEWH;
+ break;
+ }
+// modexCopyPageRegion(dest->page, src->page, x-4, y-4, x-4, y-4, 28, 40);
+// if(2>ls && ls>=1) { modexDrawSpriteRegion(dest->page, x, y, 48, dire, 24, 32, bmp); }else
+// if(3>ls && ls>=2) { modexDrawSpriteRegion(dest->page, x, y, 24, dire, 24, 32, bmp); }else
+// if(4>ls && ls>=3) { modexDrawSpriteRegion(dest->page, x, y, 0, dire, 24, 32, bmp); }else
+// if(5>ls && ls>=4) { modexDrawSpriteRegion(dest->page, x, y, 24, dire, 24, 32, bmp); }
+ //TODO: mask copy //modexCopyPageRegion(dest->page, src->page, x-4, y-4, x-4, y-4, 28, 40);
+ //modexClearRegion(top->page, 66, 66, 2, 40, 0);
+ //modexCopyPageRegion(dest->page, top->page, 66, 66, 66, 66, 2, 40);
+ //turn this off if XT
+ //XTif(detectcpu() > 0)
+// modexWaitBorder();
+}*/