From bef5bc3d2498626e6c680280c14d80a99dac8abf Mon Sep 17 00:00:00 2001 From: sparky4 Date: Thu, 20 Nov 2014 21:03:20 -0600 Subject: [PATCH] modified: 16/modex16/scroll.c modified: 16/modex16/scroll.exe added /TODO: --- 16/modex16/scroll.c | 36 +++++++++++++++++++++--------------- 16/modex16/scroll.exe | Bin 18598 -> 18598 bytes 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/16/modex16/scroll.c b/16/modex16/scroll.c index 6cf3c9d7..14aec257 100644 --- a/16/modex16/scroll.c +++ b/16/modex16/scroll.c @@ -10,7 +10,8 @@ typedef struct { word tileHeight; word tileWidth; unsigned int rows; - unsigned int cols; + unsigned int cols; + unsigned int tilex,tiley; // tile position on the map } tiles_t; @@ -25,15 +26,15 @@ typedef struct { typedef struct { map_t *map; page_t *page; - int tx; - int ty; - word dxThresh; - word dyThresh; + int tx; //???? appears to be the tile position on the viewable screen map + int ty; //???? appears to be the tile position on the viewable screen map + word dxThresh; //???? + word dyThresh; //???? } map_view_t; struct { - int tilex; - int tiley; + int tx; //player position on the viewable map + int ty; //player position on the viewable map } player; @@ -64,12 +65,12 @@ void main() { map_view_t *draw, *show, *tmp; byte *ptr; //default player position on the viewable map - player.tilex = 10; - player.tiley = 8; + player.tx = 10; + player.ty = 8; setkb(1); /* create the map */ - map = allocMap(40,30); //20x15 is the resolution of the screen you can make maps smaller than 20x15 but the null space needs to be drawn properly + 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 initMap(&map); mv.map = ↦ mv2.map = ↦ @@ -80,17 +81,22 @@ void main() { screen = modexDefaultPage(); screen.width += (TILEWH*2); mv.page = &screen; - mapGoTo(&mv, 0, 0); + mapGoTo(&mv, 16, 16); screen2=modexNextPage(mv.page); mv2.page = &screen2; - mapGoTo(&mv2, 0, 0); - modexShowPage(mv.page); - + mapGoTo(&mv2, 16, 16); + modexShowPage(mv.page); + /* set up paging */ show = &mv; draw = &mv2; + + //TODO: set player position data here according to the viewable map screen thingy - while(!keyp(1)) { + while(!keyp(1)) { + //TODO: top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square + //to stop scrolling and have the player position data move to the edge of the screen with respect to the direction + //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)){ // for(q=0; q|!JpD5{39Z=3AJ*tCB zH4%Z(23`0t5zmvLcbeWOL2jDT*_r1OJU2qMDM4>9eV!8JdU-DC=VI0e>4bk1TtuUm81wxg+Ujd)cVz>Y|vCEJPC-AKy35D2~Iad7D z7j0i0OpNnOXOs9!Il$vZw0o z+w%|UN}D{5Y-B2`a4SUxnTnRXceeE_*kPySRaft%YtY7&Lq6_j${+lAU-fJWZvuf?lMX882l{?a%5>>qoPheoW8@K<~%6I?3_IiK~K(U?H0ZN$Zz6S z2R5o{3o^MY4Q@T(6Yq5KQR~I~k^Ja>dXl6~UY1^W*2Dlk^_=k5|eunzGs5pmEmHNL{ zLe@GXl;*F6(h{wIM)DNSR#`sq_s!fuiJ+`iS}o$R7@rGlqxp%t&%>LE{Cp=Es%;5jxr3bO8u1i0US?bp;s`4~MLi+`o(g!7K$N=O$LZ+Z-xA=8lQ Uf2(M4Uxi(;RU80#gn`Q3KP_lqO#lD@ delta 839 zcmXX_YiLtR6rPjVG;Pzyrb)eNVjDG<)+%!Q!;0D$=v7pFBq(-ETNKo)|I{SNY866% z3^B!UU>9GYc304flwQS4P>H=@Q!U#xlwGYT6;Vf%#s^AEWxYFD9r)%P=A7@$`ItFZ zBXBhWXROsXEQGkok0llnQfwxqv4oJv9L-ijA{@6lSfqYlXJ4_`vvUW19ZatrGVIgm zlOaQ=-bfT6tg|RuPLwJV_Rp|8BrMIaH`$#^X)2Agf}F5F&W3ZsQk+Veppn>moT1LdIxsnL}>ut zqG#R!9L5~M1#7TUXaX1R7wRDw{}h%&4JL&Ee87$N!!U;T?3Kc#nGV)#n$HqEt|MKw zp|!epegk`f-|X{Y8QRO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