- page_t screen,screen2;\r
- map_t map;\r
- map_view_t mv, mv2;\r
- map_view_t *draw, *show, *tmp;\r
- byte *ptr;\r
- \r
- /* create the map */\r
- map = allocMap(40,30);\r
- initMap(&map);\r
- mv.map = ↦\r
- mv2.map = ↦\r
-\r
- /* draw the tiles */\r
- ptr = map.data;\r
- modexEnter();\r
- screen = modexDefaultPage();\r
- screen.width = 352;\r
- mv.page = &screen;\r
- screen2=modexNextPage(mv.page);\r
- mv2.page = &screen2;\r
- mapGoTo(&mv, 0, 0);\r
- mapGoTo(&mv2, 0, 0);\r
- modexShowPage(mv.page);\r
-\r
- /* set up paging */\r
- show = &mv;\r
- draw = &mv2;\r
-\r
- while(!keyp(1)) {\r
+ page_t screen;//,screen2;\r
+ map_t map;\r
+ map_view_t mv;//, mv2;\r
+ map_view_t *draw;//, *show, *tmp;\r
+ byte *ptr;\r
+\r
+ //default player position on the viewable map\r
+ player.tx = 10;\r
+ player.ty = 8;\r
+\r
+ setkb(1);\r
+ /* create the map */\r
+ map = allocMap(160,120); //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 = ↦\r
+// mv2.map = ↦\r
+\r
+ /* draw the tiles */\r
+ ptr = map.data;\r
+ modexEnter();\r
+ screen = modexDefaultPage();\r
+ screen.width += (TILEWH*2);\r
+ mv.page = &screen;\r
+ mapGoTo(&mv, 16, 16);\r
+// screen2=modexNextPage(mv.page);\r
+// mv2.page = &screen2;\r
+// mapGoTo(&mv2, 16, 16);\r
+// modexShowPage(mv.page);\r
+\r
+ /* set up paging */\r
+// show = &mv;\r
+// draw = &mv2;\r
+ draw = &mv;\r
+\r
+ //TODO: set player position data here according to the viewable map screen thingy\r
+\r
+ while(!keyp(1)) {\r
+ //TODO: 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\r