- show = &mv;\r
- draw = &mv2;\r
-\r
- while(!keyp(1)) {\r
- if(keyp(77)){\r
- for(q=0; q<16; q++) {\r
- mapScrollRight(draw, 1);\r
- modexShowPage(draw->page);\r
+// 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
+
+ //TODO: put player in starting position of spot\r
+ //default player position on the viewable map
+ player.tx = draw->tx + 10;
+ player.ty = draw->ty + 8;
+ player.x = player.tx*TILEWH;
+ player.y = player.ty*TILEWH;
+
+ modexShowPage(draw->page);\r
+ while(!keyp(1))
+ {\r
+ //top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square\r
+ //to stop scrolling and have the player position data move to the edge of the screen with respect to the direction\r
+ //when player.tx or player.ty == 0 or player.tx == 20 or player.ty == 15 then stop because that is edge of map and you do not want to walk of the map
+ if(keyp(77))
+ {
+ if(draw->tx >= 0 && draw->tx+20 < MAPX && player.tx == draw->tx + 10)
+ {
+ for(q=0; q<(TILEWH/SPEED); q++)
+ {\r
+ modexDrawBmp(draw->page, player.x+((q+1)*SPEED), player.y, &bmp);
+ mapScrollRight(draw, SPEED);
+ modexShowPage(draw->page);\r