--- /dev/null
+\e[0mSeg:0 Size:9962 Owner:0x0\r
+\e[41;31m+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m\e[42;32m0000\r
+\e[0m\e[0mSeg:27b3 Size:44 Owner:0x0\r
+\e[41;31m+\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:27df Size:256 Owner:0x1954\r
+\e[44;34m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:28df Size:256 Owner:0x1746\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:29df Size:256 Owner:0x1748\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2adf Size:256 Owner:0x174a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2bdf Size:256 Owner:0x174c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2cdf Size:256 Owner:0x174e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2ddf Size:256 Owner:0x1750\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2edf Size:256 Owner:0x1752\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:2fdf Size:256 Owner:0x1754\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:30df Size:256 Owner:0x1756\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:31df Size:256 Owner:0x1758\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:32df Size:256 Owner:0x175a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:33df Size:256 Owner:0x175c\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:34df Size:256 Owner:0x175e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:35df Size:256 Owner:0x1760\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:36df Size:256 Owner:0x1762\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:37df Size:256 Owner:0x1764\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:38df Size:256 Owner:0x1766\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:39df Size:256 Owner:0x1768\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3adf Size:256 Owner:0x176a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3bdf Size:256 Owner:0x176c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3cdf Size:256 Owner:0x176e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3ddf Size:256 Owner:0x1770\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3edf Size:256 Owner:0x1772\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:3fdf Size:256 Owner:0x1774\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:40df Size:256 Owner:0x1776\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:41df Size:256 Owner:0x1778\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:42df Size:256 Owner:0x177a\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:43df Size:256 Owner:0x177c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:44df Size:256 Owner:0x177e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:45df Size:256 Owner:0x1780\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:46df Size:256 Owner:0x1782\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:47df Size:256 Owner:0x1784\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:48df Size:256 Owner:0x1786\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:49df Size:256 Owner:0x1788\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4adf Size:256 Owner:0x178a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4bdf Size:256 Owner:0x178c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4cdf Size:256 Owner:0x178e\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4ddf Size:256 Owner:0x1790\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4edf Size:256 Owner:0x1792\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:4fdf Size:256 Owner:0x1794\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:50df Size:256 Owner:0x1796\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:51df Size:256 Owner:0x1798\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:52df Size:256 Owner:0x179a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:53df Size:256 Owner:0x179c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:54df Size:256 Owner:0x179e\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:55df Size:256 Owner:0x17a0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:56df Size:256 Owner:0x17a2\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:57df Size:256 Owner:0x17a4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:58df Size:256 Owner:0x17a6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:59df Size:256 Owner:0x17a8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5adf Size:256 Owner:0x17aa\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5bdf Size:256 Owner:0x17ac\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5cdf Size:256 Owner:0x17ae\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5ddf Size:256 Owner:0x17b0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5edf Size:256 Owner:0x17b2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:5fdf Size:256 Owner:0x17b4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:60df Size:256 Owner:0x17b6\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:61df Size:256 Owner:0x17b8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:62df Size:256 Owner:0x17ba\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:63df Size:256 Owner:0x17bc\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:64df Size:256 Owner:0x17be\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:65df Size:256 Owner:0x17c0\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:66df Size:256 Owner:0x17c2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:67df Size:256 Owner:0x17c4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:68df Size:256 Owner:0x17c6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:69df Size:256 Owner:0x17c8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6adf Size:256 Owner:0x17ca\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6bdf Size:256 Owner:0x17cc\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6cdf Size:256 Owner:0x17ce\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6ddf Size:256 Owner:0x17d0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6edf Size:256 Owner:0x17d2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:6fdf Size:256 Owner:0x17d4\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:70df Size:256 Owner:0x17d6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:71df Size:256 Owner:0x17d8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:72df Size:256 Owner:0x17da\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:73df Size:256 Owner:0x17dc\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:74df Size:256 Owner:0x17de\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:75df Size:256 Owner:0x17e0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:76df Size:256 Owner:0x17e2\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:77df Size:256 Owner:0x17e4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:78df Size:256 Owner:0x17e6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:79df Size:256 Owner:0x17e8\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7adf Size:256 Owner:0x17ea\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7bdf Size:256 Owner:0x17ec\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7cdf Size:256 Owner:0x17ee\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7ddf Size:256 Owner:0x17f0\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7edf Size:256 Owner:0x17f2\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:7fdf Size:256 Owner:0x17f4\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:80df Size:256 Owner:0x17f6\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:81df Size:256 Owner:0x17f8\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:82df Size:256 Owner:0x17fa\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:83df Size:256 Owner:0x17fc\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:84df Size:256 Owner:0x17fe\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:85df Size:256 Owner:0x1800\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:86df Size:256 Owner:0x1802\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:87df Size:256 Owner:0x1804\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:88df Size:256 Owner:0x1806\r
+\e[45;35m+++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:89df Size:256 Owner:0x1808\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8adf Size:256 Owner:0x180a\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8bdf Size:256 Owner:0x180c\r
+\e[45;35m++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:8cdf Size:401 Owner:0xef22\r
+\e[44;34m++++++\e[0m\e[42;32m\r
+\e[0m\e[0mSeg:b7df Size:18464 Owner:0x0\r
+\e[41;31m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\e[0m
\ No newline at end of file
*/\r
#include "src/lib/scroll16.h"\r
\r
-void walk(map_view_t *pip, player_t *player, word pn)\r
+void oldwalk(map_view_t *pip, player_t *player, word pn)\r
{\r
- #define INC_PER_FRAME if(player[pn].q&1) player[pn].persist_aniframe++; if(player[pn].persist_aniframe>4) player[pn].persist_aniframe = 1;\r
- //printf("player[%d].d=%d\n", pn, player[pn].d);\r
- switch(player[pn].d)\r
+ #define INC_PER_FRAME if(player[pn].enti.q&1) player[pn].enti.persist_aniframe++; if(player[pn].enti.persist_aniframe>4) player[pn].enti.persist_aniframe = 1;\r
+ //printf("player[%d].d=%d\n", pn, player[pn].enti.d);\r
+ switch(player[pn].enti.d)\r
{\r
//no direction\r
case 2:\r
//right movement\r
case 3:\r
//printf("pip[0].page->tilesw=%d ", pip[0].page->tilesw); printf("pip[0].page->tw=%d\n", pip[0].page->tw);\r
- if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].map->width && player[pn].tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
- !(pip[0].map->data[(player[pn].tx)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx+1 == TRIGGX && player[pn].ty == TRIGGY)) //collision detection!\r
+ if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
+ !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY)) //collision detection!\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
animatePlayer(pip, player, pn, 1);\r
//mapScrollRight(pip, player, !(pip[0].video->p), pn);\r
mapScrollRight(pip, player, (pip[0].video->p), pn);\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
- player[pn].q++;\r
+ player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
- } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
}\r
- else if(player[pn].tx < pip[0].map->width && !(pip[0].map->data[(player[pn].tx)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx+1 == TRIGGX && player[pn].ty == TRIGGY))\r
+ else if(player[pn].enti.tx < pip[0].map->width && !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
- player[pn].x+=(player[pn].speed);\r
+ player[pn].enti.x+=(player[pn].enti.speed);\r
animatePlayer(pip, player, pn, 0);\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
- player[pn].q++;\r
- } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; }\r
+ player[pn].enti.q++;\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
}\r
else\r
{\r
- if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 24, 32);\r
+ if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
#ifdef SPRITE\r
- modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR);\r
+ modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR);\r
#else\r
- modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 14);\r
+ modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 14);\r
#endif\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
- player[pn].d = 2;\r
+ player[pn].enti.d = 2;\r
}\r
- player[pn].triggerx = player[pn].tx+1;\r
- player[pn].triggery = player[pn].ty;\r
+ player[pn].enti.triggerx = player[pn].enti.tx+1;\r
+ player[pn].enti.triggery = player[pn].enti.ty;\r
break;\r
\r
//left movement\r
case 1:\r
- if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].map->width && player[pn].tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
- !(pip[0].map->data[(player[pn].tx-2)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx-1 == TRIGGX && player[pn].ty == TRIGGY)) //collision detection!\r
+ if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
+ !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY)) //collision detection!\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
animatePlayer(pip, player, pn, 1);\r
//mapScrollLeft(pip, player, !(pip[0].video->p), pn);\r
mapScrollLeft(pip, player, (pip[0].video->p), pn);\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
- player[pn].q++;\r
+ player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
- } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
}\r
- else if(player[pn].tx > 1 && !(pip[0].map->data[(player[pn].tx-2)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx-1 == TRIGGX && player[pn].ty == TRIGGY))\r
+ else if(player[pn].enti.tx > 1 && !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
- player[pn].x-=(player[pn].speed);\r
+ player[pn].enti.x-=(player[pn].enti.speed);\r
animatePlayer(pip, player, pn, 0);\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
- player[pn].q++;\r
- } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; }\r
+ player[pn].enti.q++;\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
}\r
else\r
{\r
- if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 24, 32);\r
+ if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
#ifdef SPRITE\r
- modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR);\r
+ modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR);\r
#else\r
- modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 10);\r
+ modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 10);\r
#endif\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
- player[pn].d = 2;\r
+ player[pn].enti.d = 2;\r
}\r
- player[pn].triggerx = player[pn].tx-1;\r
- player[pn].triggery = player[pn].ty;\r
+ player[pn].enti.triggerx = player[pn].enti.tx-1;\r
+ player[pn].enti.triggery = player[pn].enti.ty;\r
break;\r
\r
//down movement\r
case 4:\r
- if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].map->height && player[pn].ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
- !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty+1 == TRIGGY)) //collision detection!\r
+ if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
+ !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY)) //collision detection!\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
animatePlayer(pip, player, pn, 1);\r
//mapScrollDown(pip, player, !(pip[0].video->p), pn);\r
mapScrollDown(pip, player, (pip[0].video->p), pn);\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
- player[pn].q++;\r
+ player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
- } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
}\r
- else if(player[pn].ty < pip[0].map->height && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty+1 == TRIGGY))\r
+ else if(player[pn].enti.ty < pip[0].map->height && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
- player[pn].y+=(player[pn].speed);\r
+ player[pn].enti.y+=(player[pn].enti.speed);\r
animatePlayer(pip, player, pn, 0);\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
- player[pn].q++;\r
- } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; }\r
+ player[pn].enti.q++;\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
}\r
else\r
{\r
- if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 24, 32);\r
+ if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
#ifdef SPRITE\r
- modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR);\r
+ modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR);\r
#else\r
- modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 9);\r
+ modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 9);\r
#endif\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
- player[pn].d = 2;\r
+ player[pn].enti.d = 2;\r
}\r
- player[pn].triggerx = player[pn].tx;\r
- player[pn].triggery = player[pn].ty+1;\r
+ player[pn].enti.triggerx = player[pn].enti.tx;\r
+ player[pn].enti.triggery = player[pn].enti.ty+1;\r
break;\r
\r
//up movement\r
case 0:\r
- if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].map->height && player[pn].ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
- !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty-2))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty-1 == TRIGGY)) //collision detection!\r
+ if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
+ !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY)) //collision detection!\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
animatePlayer(pip, player, pn, 1);\r
//mapScrollUp(pip, player, !(pip[0].video->p), pn);\r
mapScrollUp(pip, player, (pip[0].video->p), pn);\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
- player[pn].q++;\r
+ player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
- } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
}\r
- else if(player[pn].ty > 1 && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty-2))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty-1 == TRIGGY))\r
+ else if(player[pn].enti.ty > 1 && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY))\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
- player[pn].y-=(player[pn].speed);\r
+ player[pn].enti.y-=(player[pn].enti.speed);\r
animatePlayer(pip, player, 0, pn);\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
- player[pn].q++;\r
- } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; }\r
+ player[pn].enti.q++;\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
}\r
else\r
{\r
- if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].x, player[pn].y-TILEWH, player[pn].x, player[pn].y-TILEWH, 24, 32);\r
+ if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32);\r
#ifdef SPRITE\r
- modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR);\r
+ modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR);\r
#else\r
- modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 12);\r
+ modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 12);\r
#endif\r
if(!pageflipflop) modexShowPage(pip[1].page);\r
- player[pn].d = 2;\r
+ player[pn].enti.d = 2;\r
}\r
- player[pn].triggerx = player[pn].tx;\r
- player[pn].triggery = player[pn].ty-1;\r
+ player[pn].enti.triggerx = player[pn].enti.tx;\r
+ player[pn].enti.triggery = player[pn].enti.ty-1;\r
break;\r
}\r
}\r
\r
void ZC_walk(map_view_t *pip, player_t *player, word pn)\r
{\r
- #define INC_PER_FRAME if(player[pn].q&1) player[pn].persist_aniframe++; if(player[pn].persist_aniframe>4) player[pn].persist_aniframe = 1;\r
- switch(player[pn].d)\r
+ #define INC_PER_FRAME if(player[pn].enti.q&1) player[pn].enti.persist_aniframe++; if(player[pn].enti.persist_aniframe>4) player[pn].enti.persist_aniframe = 1;\r
+ switch(player[pn].enti.d)\r
{\r
//no direction\r
case 2:\r
break;\r
//right movement\r
case 3:\r
- if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].map->width && player[pn].tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
- !(pip[0].map->data[(player[pn].tx)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx+1 == TRIGGX && player[pn].ty == TRIGGY)) //collision detection!\r
+ if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
+ !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY)) //collision detection!\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
animatePlayer(pip, player, pn, 1);\r
ScrollRight(pip, player, 3, pn);\r
ScrollRight(pip, player, 2, pn);\r
mapScrollRight(pip, player, (pip[0].video->p), pn);\r
- player[pn].q++;\r
+ player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
- } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
}\r
- else if(player[pn].tx < pip[0].map->width && !(pip[0].map->data[(player[pn].tx)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx+1 == TRIGGX && player[pn].ty == TRIGGY))\r
+ else if(player[pn].enti.tx < pip[0].map->width && !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
- player[pn].x+=(player[pn].speed);\r
+ player[pn].enti.x+=(player[pn].enti.speed);\r
animatePlayer(pip, player, pn, 0);\r
- player[pn].q++;\r
- } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; }\r
+ player[pn].enti.q++;\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
}\r
else\r
{\r
#ifdef SPRITE\r
- modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR);\r
+ modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 24, 32, PLAYERBMPDATAPTR);\r
#else\r
- modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 14);\r
+ modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 14);\r
#endif\r
- player[pn].d = 2;\r
+ player[pn].enti.d = 2;\r
}\r
- player[pn].triggerx = player[pn].tx+1;\r
- player[pn].triggery = player[pn].ty;\r
+ player[pn].enti.triggerx = player[pn].enti.tx+1;\r
+ player[pn].enti.triggery = player[pn].enti.ty;\r
break;\r
//left movement\r
case 1:\r
- if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].map->width && player[pn].tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
- !(pip[0].map->data[(player[pn].tx-2)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx-1 == TRIGGX && player[pn].ty == TRIGGY)) //collision detection!\r
+ if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].map->width && player[pn].enti.tx == pip[0].tx+pip[0].page->tilemidposscreenx &&\r
+ !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY)) //collision detection!\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
animatePlayer(pip, player, pn, 1);\r
ScrollLeft(pip, player, 3, pn);\r
ScrollLeft(pip, player, 2, pn);\r
mapScrollLeft(pip, player, (pip[0].video->p), pn);\r
- player[pn].q++;\r
+ player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
- } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
}\r
- else if(player[pn].tx > 1 && !(pip[0].map->data[(player[pn].tx-2)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx-1 == TRIGGX && player[pn].ty == TRIGGY))\r
+ else if(player[pn].enti.tx > 1 && !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY))\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
- player[pn].x-=(player[pn].speed);\r
+ player[pn].enti.x-=(player[pn].enti.speed);\r
animatePlayer(pip, player, pn, 0);\r
- player[pn].q++;\r
- } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; }\r
+ player[pn].enti.q++;\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
}\r
else\r
{\r
#ifdef SPRITE\r
- modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR);\r
+ modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 96, 24, 32, PLAYERBMPDATAPTR);\r
#else\r
- modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 10);\r
+ modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 10);\r
#endif\r
- player[pn].d = 2;\r
+ player[pn].enti.d = 2;\r
}\r
- player[pn].triggerx = player[pn].tx-1;\r
- player[pn].triggery = player[pn].ty;\r
+ player[pn].enti.triggerx = player[pn].enti.tx-1;\r
+ player[pn].enti.triggery = player[pn].enti.ty;\r
break;\r
//down movement\r
case 4:\r
- if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].map->height && player[pn].ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
- !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty+1 == TRIGGY)) //collision detection!\r
+ if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
+ !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY)) //collision detection!\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
animatePlayer(pip, player, pn, 1);\r
ScrollDown(pip, player, 3, pn);\r
ScrollDown(pip, player, 2, pn);\r
mapScrollDown(pip, player, (pip[0].video->p), pn);\r
- player[pn].q++;\r
+ player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
- } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
}\r
- else if(player[pn].ty < pip[0].map->height && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty+1 == TRIGGY))\r
+ else if(player[pn].enti.ty < pip[0].map->height && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY))\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
- player[pn].y+=(player[pn].speed);\r
+ player[pn].enti.y+=(player[pn].enti.speed);\r
animatePlayer(pip, player, pn, 0);\r
- player[pn].q++;\r
- } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; }\r
+ player[pn].enti.q++;\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
}\r
else\r
{\r
#ifdef SPRITE\r
- modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR);\r
+ modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 64, 24, 32, PLAYERBMPDATAPTR);\r
#else\r
- modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 9);\r
+ modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 9);\r
#endif\r
- player[pn].d = 2;\r
+ player[pn].enti.d = 2;\r
}\r
- player[pn].triggerx = player[pn].tx;\r
- player[pn].triggery = player[pn].ty+1;\r
+ player[pn].enti.triggerx = player[pn].enti.tx;\r
+ player[pn].enti.triggery = player[pn].enti.ty+1;\r
break;\r
//up movement\r
case 0:\r
- if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].map->height && player[pn].ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
- !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty-2))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty-1 == TRIGGY)) //collision detection!\r
+ if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].map->height && player[pn].enti.ty == pip[0].ty+pip[0].page->tilemidposscreeny &&\r
+ !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY)) //collision detection!\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
animatePlayer(pip, player, pn, 1);\r
ScrollUp(pip, player, 3, pn);\r
ScrollUp(pip, player, 2, pn);\r
mapScrollUp(pip, player, (pip[0].video->p), pn);\r
- player[pn].q++;\r
+ player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
- } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; }\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
}\r
- else if(player[pn].ty > 1 && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty-2))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty-1 == TRIGGY))\r
+ else if(player[pn].enti.ty > 1 && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY))\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
INC_PER_FRAME;\r
- player[pn].y-=(player[pn].speed);\r
+ player[pn].enti.y-=(player[pn].enti.speed);\r
animatePlayer(pip, player, 0, pn);\r
- player[pn].q++;\r
- } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; }\r
+ player[pn].enti.q++;\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
}\r
else\r
{\r
#ifdef SPRITE\r
- modexDrawSpriteRegion(pip[0].page, player[pn].x, player[pn].y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR);\r
+ modexDrawSpriteRegion(pip[0].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 0, 24, 32, PLAYERBMPDATAPTR);\r
#else\r
- modexClearRegion(pip[1].page, player[pn].x, player[pn].y-TILEWH, 24, 32, 12);\r
+ modexClearRegion(pip[1].page, player[pn].enti.x, player[pn].enti.y-TILEWH, 24, 32, 12);\r
#endif\r
- player[pn].d = 2;\r
+ player[pn].enti.d = 2;\r
}\r
- player[pn].triggerx = player[pn].tx;\r
- player[pn].triggery = player[pn].ty-1;\r
+ player[pn].enti.triggerx = player[pn].enti.tx;\r
+ player[pn].enti.triggery = player[pn].enti.ty-1;\r
break;\r
}\r
}\r
void ZC_panPageManual(map_view_t *pip, player_t *player, word pn)\r
{\r
#define SHOWMVFUN_ ZC_ShowMV(pip, 0, 0);\r
- switch(player[pn].d)\r
+ switch(player[pn].enti.d)\r
{\r
//right movement\r
case 3:\r
if(pip[0].tx >= 0 && pip[0].tx+pip[0].page->tw < pip[0].page->tilesw)\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
pip[0].page->dx+=4;\r
SHOWMVFUN_;\r
- player[pn].q++;\r
- } else { player[pn].q = 1; player[pn].d = 2; pip[0].tx++; }\r
+ player[pn].enti.q++;\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].tx++; }\r
}\r
break;\r
\r
case 1:\r
if(pip[0].tx > 0 && pip[0].tx+pip[0].page->tw <= pip[0].page->tilesw)\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
pip[0].page->dx-=4;\r
SHOWMVFUN_;\r
- player[pn].q++;\r
- } else { player[pn].q = 1; player[pn].d = 2; pip[0].tx--; }\r
+ player[pn].enti.q++;\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].tx--; }\r
}\r
break;\r
\r
case 4:\r
if(pip[0].ty >= 0 && pip[0].ty+pip[0].page->th < pip[0].page->tilesh)\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
pip[0].page->dy+=4;\r
SHOWMVFUN_;\r
- player[pn].q++;\r
- } else { player[pn].q = 1; player[pn].d = 2; pip[0].ty++; }\r
+ player[pn].enti.q++;\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].ty++; }\r
}\r
break;\r
\r
case 0:\r
if(pip[0].ty > 0 && pip[0].ty+pip[0].page->th <= pip[0].page->tilesh)\r
{\r
- if(player[pn].q<=player[pn].spt)\r
+ if(player[pn].enti.q<=player[pn].enti.spt)\r
{\r
pip[0].page->dy-=4;\r
SHOWMVFUN_;\r
- player[pn].q++;\r
- } else { player[pn].q = 1; player[pn].d = 2; pip[0].ty--; }\r
+ player[pn].enti.q++;\r
+ } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].ty--; }\r
}\r
break;\r
}\r
word x;//, y; /* coordinate for drawing */\r
\r
/* increment the pixel position and update the page */\r
- mv[id].page[0].dx += player[plid].speed;\r
+ mv[id].page[0].dx += player[plid].enti.speed;\r
\r
/* check to see if this changes the tile */\r
if(mv[id].page[0].dx >= mv[id].dxThresh )\r
\r
/* draw the next column */\r
x= mv[0].page->sw + mv[id].map->tiles->tileWidth;\r
- if(player[plid].q%4)\r
+ if(player[plid].enti.q%4)\r
if(id==0)\r
mapDrawCol(&mv[0], mv[0].tx + mv[0].page->tw, mv[0].ty-1, x, player, mv->page[0].dx);\r
else\r
word x;//,y; /* coordinate for drawing */\r
\r
/* decrement the pixel position and update the page */\r
- mv[id].page[0].dx -= player[plid].speed;\r
+ mv[id].page[0].dx -= player[plid].enti.speed;\r
\r
/* check to see if this changes the tile */\r
if(mv[id].page[0].dx == 0)\r
\r
/* draw the next column */\r
x= 0;\r
- if(player[plid].q%4)\r
+ if(player[plid].enti.q%4)\r
if(id==0)\r
mapDrawCol(&mv[0], mv[0].tx - 1, mv[0].ty-1, x, player, mv->page[0].dx);\r
else\r
word y;//x, /* coordinate for drawing */\r
\r
/* decrement the pixel position and update the page */\r
- mv[id].page[0].dy -= player[plid].speed;\r
+ mv[id].page[0].dy -= player[plid].enti.speed;\r
\r
/* check to see if this changes the tile */\r
if(mv[id].page[0].dy == 0 )\r
\r
/* draw the next row */\r
y= 0;\r
- if(player[plid].q%3)\r
+ if(player[plid].enti.q%3)\r
if(id==0)\r
mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty-1, y, player, mv->page[0].dy);\r
else\r
word y;//x, /* coordinate for drawing */\r
\r
/* increment the pixel position and update the page */\r
- mv[id].page[0].dy += player[plid].speed;\r
+ mv[id].page[0].dy += player[plid].enti.speed;\r
\r
/* check to see if this changes the tile */\r
if(mv[id].page[0].dy >= mv[id].dyThresh )\r
\r
/* draw the next row */\r
y= mv[0].page->sh + mv[id].map->tiles->tileHeight;\r
- if(player[plid].q%3)\r
+ if(player[plid].enti.q%3)\r
if(id==0)\r
mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty+mv[0].page->th, y, player, mv->page[0].dy);\r
else\r
void near ScrollRight(map_view_t *mv, player_t *player, word id, word plid)\r
{\r
/* increment the pixel position and update the page */\r
- mv[id].page->dx += player[plid].speed;\r
+ mv[id].page->dx += player[plid].enti.speed;\r
\r
/* check to see if this changes the tile */\r
if(mv[id].page->dx >= mv[0].dxThresh )\r
void near ScrollLeft(map_view_t *mv, player_t *player, word id, word plid)\r
{\r
/* decrement the pixel position and update the page */\r
- mv[id].page->dx -= player[plid].speed;\r
+ mv[id].page->dx -= player[plid].enti.speed;\r
\r
/* check to see if this changes the tile */\r
if(mv[id].page->dx == 0)\r
void near ScrollUp(map_view_t *mv, player_t *player, word id, word plid)\r
{\r
/* decrement the pixel position and update the page */\r
- mv[id].page->dy -= player[plid].speed;\r
+ mv[id].page->dy -= player[plid].enti.speed;\r
\r
/* check to see if this changes the tile */\r
if(mv[id].page->dy == 0)\r
void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid)\r
{\r
/* increment the pixel position and update the page */\r
- mv[id].page->dy += player[plid].speed;\r
+ mv[id].page->dy += player[plid].enti.speed;\r
\r
/* check to see if this changes the tile */\r
if(mv[id].page->dy >= mv[0].dxThresh )\r
//default player position on the viewable map\r
void playerXYpos(int x, int y, player_t *player, map_view_t *pip, nibble pn)\r
{\r
- player[pn].tx = x + pip[0].tx + pip[0].page->tilemidposscreenx;\r
- player[pn].ty = y + pip[0].ty + pip[0].page->tilemidposscreeny;\r
+ player[pn].enti.tx = x + pip[0].tx + pip[0].page->tilemidposscreenx;\r
+ player[pn].enti.ty = y + pip[0].ty + pip[0].page->tilemidposscreeny;\r
}\r
//===========================================================================\r
\r
}\r
}\r
\r
-void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *p, word poopoffset)\r
+void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *player, word poopoffset)\r
{\r
word x;\r
int i;\r
- poopoffset%=p[0].speed;\r
+ poopoffset%=player[0].enti.speed;\r
//printf("y: %d\n", poopoffset);\r
/* the position within the map array */\r
i=ty * mv->map->width + tx;\r
}\r
}\r
\r
-void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *p, word poopoffset)\r
+void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *player, word poopoffset)\r
{\r
int y;\r
int i;\r
- poopoffset%=p[0].speed;\r
+ poopoffset%=player[0].enti.speed;\r
//printf("x: %d\n", poopoffset);\r
/* location in the map array */\r
i=ty * mv->map->width + tx;\r
}\r
}\r
\r
+#ifdef SPRITE\r
+#define FRAME1 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 48, dire, 24, 32, PLAYERBMPDATAPTR);\r
+#define FRAME2 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32, PLAYERBMPDATAPTR);\r
+#define FRAME3 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 0, dire, 24, 32, PLAYERBMPDATAPTR);\r
+#define FRAME4 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32, PLAYERBMPDATAPTR);\r
+#else\r
+#define FRAME1 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 2+dire);\r
+#define FRAME2 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire);\r
+#define FRAME3 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, dire);\r
+#define FRAME4 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire);\r
+#endif\r
+\r
void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch)\r
{\r
- sword x = player[pn].x;\r
- sword y = player[pn].y;\r
+ sword x = player[pn].enti.x;\r
+ sword y = player[pn].enti.y;\r
sword bx = x+16; //buffer's x\r
sword by = y+16; //buffer's y\r
word dire=32; //direction\r
sword qq; //scroll offset\r
- word ls = player[pn].persist_aniframe;\r
+ word ls = player[pn].enti.persist_aniframe;\r
\r
switch(scrollswitch)\r
{\r
qq = 0;\r
break;\r
default:\r
- qq = ((player[pn].q)*(player[pn].speed));\r
+ qq = ((player[pn].enti.q)*(player[pn].enti.speed));\r
break;\r
}\r
//x-=4;\r
y-=pip[0].map->tiles->tileHeight;\r
- switch (player[pn].d)\r
+ switch (player[pn].enti.d)\r
{\r
case 0:\r
//up\r
- dire*=player[pn].d;\r
+ dire*=player[pn].enti.d;\r
y-=qq;\r
by-=4;\r
break;\r
case 3:\r
// right\r
- dire*=(player[pn].d-2);\r
+ dire*=(player[pn].enti.d-2);\r
x+=qq;\r
bx+=4;\r
break;\r
break;\r
case 4:\r
//down\r
- dire*=(player[pn].d-2);\r
+ dire*=(player[pn].enti.d-2);\r
y+=qq;\r
by+=4;\r
break;\r
case 1:\r
//left\r
- dire*=(player[pn].d+2);\r
+ dire*=(player[pn].enti.d+2);\r
+ x-=qq;\r
+ bx-=4;\r
+ break;\r
+ }\r
+\r
+ if(!pageflipflop)\r
+ modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 36);\r
+ else{\r
+ //copy old bg to page0\r
+ //modexCopyPageRegion(pip[3].page, pip[0].page, bx, by, 0, 0, 20, 36);\r
+ //update buffer\r
+ //modexCopyPageRegion(pip[0].page, pip[3].page, 0, 0, x, y, 20, 36);\r
+ }\r
+//modexCopyPageRegion(page_t *dest, page_t *src, word sx, word sy, word dx, word dy, word width, word height);\r
+ //modexCopyPageRegion(pip[3].page, pip[!(pip->video->p)].page, x-4, y-4, 0, 128, 28, 36);\r
+ /*modexCopyPageRegion(pip[pip->video->p].page,\r
+ pip[!(pip->video->p)].page, x-4, y-4, x-4, y-4, 28, 36);*/\r
+// else modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 40);\r
+ switch(ls)\r
+ {\r
+ case 1:\r
+ FRAME1\r
+ break;\r
+ case 2:\r
+ FRAME2\r
+ break;\r
+ case 3:\r
+ FRAME3\r
+ break;\r
+ case 4:\r
+ FRAME4\r
+ break;\r
+ }\r
+// if(2>ls && ls>=1) { FRAME1 }else\r
+// if(3>ls && ls>=2) { FRAME2 }else\r
+// if(4>ls && ls>=3) { FRAME3 }else\r
+// if(5>ls && ls>=4) { FRAME4 }\r
+ //modexCopyPageRegion(pip[0].page, pip[3].page, 0, 0, x, y, 24, 32);\r
+ //printf("x=%d y=%d bx=%d by=%d\n", x, y, bx, by);\r
+ pip->video->r=1;\r
+}\r
+\r
+void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch)\r
+{\r
+ sword x = player[pn].enti.x;\r
+ sword y = player[pn].enti.y;\r
+ sword bx = x+16; //buffer's x\r
+ sword by = y+16; //buffer's y\r
+ word dire=32; //direction\r
+ sword qq; //scroll offset\r
+ word ls = player[pn].enti.persist_aniframe;\r
+\r
+ switch(scrollswitch)\r
+ {\r
+ case 0:\r
+ qq = 0;\r
+ break;\r
+ default:\r
+ qq = ((player[pn].enti.q)*(player[pn].enti.speed));\r
+ break;\r
+ }\r
+ //x-=4;\r
+ y-=pip[0].map->tiles->tileHeight;\r
+ switch (player[pn].enti.d)\r
+ {\r
+ case 0:\r
+ //up\r
+ dire*=player[pn].enti.d;\r
+ y-=qq;\r
+ by-=4;\r
+ break;\r
+ case 3:\r
+ // right\r
+ dire*=(player[pn].enti.d-2);\r
+ x+=qq;\r
+ bx+=4;\r
+ break;\r
+ case 2:\r
+ break;\r
+ case 4:\r
+ //down\r
+ dire*=(player[pn].enti.d-2);\r
+ y+=qq;\r
+ by+=4;\r
+ break;\r
+ case 1:\r
+ //left\r
+ dire*=(player[pn].enti.d+2);\r
x-=qq;\r
bx-=4;\r
break;\r
}\r
\r
-#ifdef SPRITE\r
-#define FRAME1 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 48, dire, 24, 32, PLAYERBMPDATAPTR);\r
-#define FRAME2 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32, PLAYERBMPDATAPTR);\r
-#define FRAME3 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 0, dire, 24, 32, PLAYERBMPDATAPTR);\r
-#define FRAME4 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32, PLAYERBMPDATAPTR);\r
-#else\r
-#define FRAME1 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 2+dire);\r
-#define FRAME2 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire);\r
-#define FRAME3 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, dire);\r
-#define FRAME4 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, 32, 1+dire);\r
-#endif\r
if(!pageflipflop)\r
modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 36);\r
else{\r
\r
void player_walk(player_t *player, map_view_t *map_v){\r
int dx=16, dy=16;\r
- if(ZC_walk2(player->ent, map_v) && boundary_check(map_v->tx, map_v->ty, dx, dy, map_v->map->width - 2*map_v->page->tilesw, map_v->map->height - 2*map_v->page->tilesh))\r
+ if(ZC_walk2(&(player->enti), map_v) && boundary_check(map_v->tx, map_v->ty, dx, dy, map_v->map->width - 2*map_v->page->tilesw, map_v->map->height - 2*map_v->page->tilesh))\r
{\r
mapScroll(map_v, player);\r
// (Un)load stuff?\r