page_t *page;\r
int tx; //appears to be the top left tile position on the viewable screen map\r
int ty; //appears to be the top left tile position on the viewable screen map
-// int ttx; //bottem right tile
-// int tty; //bottem left tile\r
word dxThresh; //????\r
word dyThresh; //????\r
} map_view_t;\r
int x; //player exact position on the viewable map\r
int y; //player exact position on the viewable map\r
int tx; //player tile position on the viewable map\r
- int ty; //player tile position on the viewable map\r
+ int ty; //player tile position on the viewable map
+ int hp; //hitpoints of the player\r
} player;\r
\r
\r
//place holder definitions
#define MAPX 40
#define MAPY 30\r
-//#define SWAP(a, b) tmp=a; a=b; b=tmp;\r
+#define SWAP(a, b) tmp=a; a=b; b=tmp;\r
void main() {\r
bitmap_t ptmp; // player sprite\r
int q=0;\r
map = allocMap(MAPX,MAPY); //20x15 is the resolution of the screen you can make maps smaller than 20x15 but the null space needs to be drawn properly\r
initMap(&map);\r
mv.map = ↦
-// mv2.map = ↦\r
+ mv2.map = ↦\r
\r
/* draw the tiles */\r
ptr = map.data;
screen = modexDefaultPage();\r
screen.width += (TILEWH*2);\r
mv.page = &screen;\r
-// screen2=modexNextPage(mv.page);\r
-// mv2.page = &screen2;\r
-// mapGoTo(&mv2, 16, 16);\r
-// modexShowPage(mv.page);\r
+ screen2=modexNextPage(mv.page);\r
+ mv2.page = &screen2;\r
+ modexShowPage(mv.page);\r
\r
/* set up paging */\r
-// show = &mv;\r
-// draw = &mv2;\r
- draw = &mv;
+ show = &mv;\r
+ draw = &mv2;\r
+// draw = &mv;
//TODO: LOAD map data and position the map in the middle of the screen if smaller then screen
- mapGoTo(draw, 0, 0);\r
+ mapGoTo(draw, 0, 0);
+ mapGoTo(show, 0, 0);\r
//TODO: put player in starting position of spot\r
//default player position on the viewable map
animatePlayer(draw, 1, 1, player.x, player.y, q, &ptmp);
mapScrollRight(draw, SPEED);
modexShowPage(draw->page);\r
-// mapScrollRight(draw, 1);\r
-// SWAP(draw, show);\r
+// mapScrollRight(draw, SPEED);\r
+// SWAP(draw, show);\r
}
player.tx++;
}
animatePlayer(draw, 3, 1, player.x, player.y, q, &ptmp);
mapScrollLeft(draw, SPEED);
modexShowPage(draw->page);\r
-// mapScrollLeft(show, 1);\r
-// SWAP(draw, show);\r
+// mapScrollLeft(show, SPEED);\r
+// SWAP(draw, show);\r
}
player.tx--;\r
}
\r
if(keyp(80))
{
- modexDrawSpriteRegion(draw->page, player.x-4, player.y-TILEWH, 24, 64, 24, 32, &ptmp);
+// modexDrawSpriteRegion(draw->page, player.x-4, player.y-TILEWH, 24, 64, 24, 32, &ptmp);
if(draw->ty >= 0 && draw->ty+15 < MAPY && player.ty == draw->ty + 8)
{\r
for(q=0; q<(TILEWH/SPEED); q++)
animatePlayer(draw, 2, 1, player.x, player.y, q, &ptmp);
mapScrollDown(draw, SPEED);
modexShowPage(draw->page);\r
-// mapScrollDown(show, 1);\r
-// SWAP(draw, show);\r
+// mapScrollDown(show, SPEED);\r
+// SWAP(draw, show);\r
}
player.ty++;
}
animatePlayer(draw, 0, 1, player.x, player.y, q, &ptmp);
mapScrollUp(draw, SPEED);
modexShowPage(draw->page);
-// mapScrollUp(show, 1);\r
-// SWAP(draw, show);\r
+// mapScrollUp(show, SPEED);\r
+// SWAP(draw, show);\r
}
player.ty--;
}