From d4a852fe1e7ec08655f5f19d40064c592b95f2e4 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Mon, 24 Nov 2014 03:30:19 -0600 Subject: [PATCH] modified: Project 16.bfproject modified: scroll.c modified: scroll.exe --- Project 16.bfproject | 26 +++++++++++++------------- scroll.c | 38 ++++++++++++++++++++++---------------- scroll.exe | Bin 20160 -> 20434 bytes 3 files changed, 35 insertions(+), 29 deletions(-) diff --git a/Project 16.bfproject b/Project 16.bfproject index ca24de07..39b70fd3 100644 --- a/Project 16.bfproject +++ b/Project 16.bfproject @@ -1,7 +1,7 @@ c2e.convert_special: 0 e2c.convert_num: 0 openfiles: /dos/z/16/doc/project.txt:102:0:0: -openfiles: /dos/z/16/scroll.c:0:2959:1: +openfiles: /dos/z/16/scroll.c:12437:11784:1: openfiles: /dos/z/16/modex16.c:9475:0:0: openfiles: /dos/z/16/modex16.h:1512:344:0: openfiles: /dos/z/16/pcxtest.c:1339:442:0: @@ -22,13 +22,10 @@ c2e.convert_iso: 0 opendir: file:///dos/z/16/lib wrap_text_default: 0 bookmarks_filename_mode: 1 -ssearch_text: )*2 +ssearch_text: inc_ snr_casesens: 1 view_blocks: 1 name: project 16 -replacelist: animatePlayer(spri -replacelist: modexDrawSpriteRegion(spri -replacelist: spri->page = modexDefaultPage(); replacelist: screen2=modexNextPage(mv.page); replacelist: spri->page=draw->page; replacelist: mv @@ -41,6 +38,9 @@ replacelist: 34); replacelist: bg replacelist: dest replacelist: animatePlayer(bg, spri, +replacelist: qi=1 +replacelist: qi<=( +replacelist: \t\t\t\t fb_show_hidden_f: 0 editor_tab_width: 4 show_visible_spacing: 1 @@ -96,14 +96,14 @@ recent_files: file:///dos/z/16/16/lib/x/MODEX.H recent_files: file:///dos/z/16/16/modex16/dos_kb.h recent_files: file:///dos/z/16/doc/16.16 recent_files: file:///dos/z/16/doc/16story.txt -recent_files: file:///dos/z/16/scroll.c recent_files: file:///dos/z/16/doc/project.txt -recent_files: file:///dos/z/16/modex16.h -recent_files: file:///dos/z/16/pcxtest.c -recent_files: file:///dos/z/16/dos_kb.c recent_files: file:///dos/z/16/dos_kb.h recent_files: file:///dos/z/16/lib/lib_head.h +recent_files: file:///dos/z/16/dos_kb.c +recent_files: file:///dos/z/16/modex16.h +recent_files: file:///dos/z/16/pcxtest.c recent_files: file:///dos/z/16/modex16.c +recent_files: file:///dos/z/16/scroll.c snr_replacetype: 0 savedir: file:///dos/z/16 spell_check_default: 1 @@ -115,10 +115,6 @@ snr_escape_chars: 0 htmlbar_view: 0 spell_lang: en ssearch_dotmatchall: 0 -searchlist: wPage(draw -searchlist: 32); -searchlist: 33) -searchlist: 3) searchlist: draw searchlist: 34) searchlist: 0x3DA @@ -129,7 +125,11 @@ searchlist: clearpl searchlist: modexDrawSpriteRegion searchlist: bg searchlist: )*- +searchlist: qi=0 +searchlist: qi<( +searchlist: searchlist: )*2 +searchlist: inc_ autocomplete: 1 outputb_show_all_output: 0 bookmarks_show_mode: 0 diff --git a/scroll.c b/scroll.c index da3369eb..aeee5929 100644 --- a/scroll.c +++ b/scroll.c @@ -51,7 +51,7 @@ void mapGoTo(map_view_t *mv, int tx, int ty); void mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y); void mapDrawRow(map_view_t *mv, int tx, int ty, word y); void mapDrawCol(map_view_t *mv, int tx, int ty, word x); -void animatePlayer(map_view_t *src, map_view_t *dest, short d1, short d2, int x, int y, int ls, bitmap_t *bmp); +void animatePlayer(map_view_t *src, map_view_t *dest, short d1, short d2, int x, int y, int ls, int lp, bitmap_t *bmp); #define TILEWH 16 #define QUADWH (TILEWH/4) @@ -64,6 +64,7 @@ void animatePlayer(map_view_t *src, map_view_t *dest, short d1, short d2, int x, void main() { bitmap_t ptmp; // player sprite int q=1; + static int persist_aniframe = 0; /* gonna be increased to 1 before being used, so 0 is ok for default */ page_t screen, screen2; map_t map; map_view_t mv, mv2; @@ -112,15 +113,16 @@ void main() { //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 - //TODO: render the player properly with animation and sprite sheet - //TODO: fexible speeds + #define INC_PER_FRAME if(q&1) persist_aniframe++; if(persist_aniframe>4) persist_aniframe = 1; + if(keyp(77) && !keyp(75)) { if(bg->tx >= 0 && bg->tx+20 < MAPX && player.tx == bg->tx + 10) { for(q=1; q<=(TILEWH/SPEED); q++) { - animatePlayer(bg, spri, 1, 1, player.x, player.y, q, &ptmp); + INC_PER_FRAME; + animatePlayer(bg, spri, 1, 1, player.x, player.y, persist_aniframe, q, &ptmp); mapScrollRight(bg, SPEED); mapScrollRight(spri, SPEED); modexShowPage(spri->page); @@ -131,8 +133,9 @@ void main() { { for(q=1; q<=(TILEWH/SPEED); q++) { + INC_PER_FRAME; player.x+=SPEED; - animatePlayer(bg, spri, 1, 0, player.x, player.y, q, &ptmp); + animatePlayer(bg, spri, 1, 0, player.x, player.y, persist_aniframe, q, &ptmp); modexShowPage(spri->page); } player.tx++; @@ -151,8 +154,8 @@ void main() { { for(q=1; q<=(TILEWH/SPEED); q++) { - - animatePlayer(bg, spri, 3, 1, player.x, player.y, q, &ptmp); + INC_PER_FRAME; + animatePlayer(bg, spri, 3, 1, player.x, player.y, persist_aniframe, q, &ptmp); mapScrollLeft(bg, SPEED); mapScrollLeft(spri, SPEED); modexShowPage(spri->page); @@ -163,8 +166,9 @@ void main() { { for(q=1; q<=(TILEWH/SPEED); q++) { + INC_PER_FRAME; player.x-=SPEED; - animatePlayer(bg, spri, 3, 0, player.x, player.y, q, &ptmp); + animatePlayer(bg, spri, 3, 0, player.x, player.y, persist_aniframe, q, &ptmp); modexShowPage(spri->page); } player.tx--; @@ -183,7 +187,8 @@ void main() { { for(q=1; q<=(TILEWH/SPEED); q++) { - animatePlayer(bg, spri, 2, 1, player.x, player.y, q, &ptmp); + INC_PER_FRAME; + animatePlayer(bg, spri, 2, 1, player.x, player.y, persist_aniframe, q, &ptmp); mapScrollDown(bg, SPEED); mapScrollDown(spri, SPEED); modexShowPage(spri->page); @@ -194,8 +199,9 @@ void main() { { for(q=1; q<=(TILEWH/SPEED); q++) { + INC_PER_FRAME; player.y+=SPEED; - animatePlayer(bg, spri, 2, 0, player.x, player.y, q, &ptmp); + animatePlayer(bg, spri, 2, 0, player.x, player.y, persist_aniframe, q, &ptmp); modexShowPage(spri->page); } player.ty++; @@ -214,7 +220,8 @@ void main() { { for(q=1; q<=(TILEWH/SPEED); q++) { - animatePlayer(bg, spri, 0, 1, player.x, player.y, q, &ptmp); + INC_PER_FRAME; + animatePlayer(bg, spri, 0, 1, player.x, player.y, persist_aniframe, q, &ptmp); mapScrollUp(bg, SPEED); mapScrollUp(spri, SPEED); modexShowPage(spri->page); @@ -225,8 +232,9 @@ void main() { { for(q=1; q<=(TILEWH/SPEED); q++) { + INC_PER_FRAME; player.y-=SPEED; - animatePlayer(bg, spri, 0, 0, player.x, player.y, q, &ptmp); + animatePlayer(bg, spri, 0, 0, player.x, player.y, persist_aniframe, q, &ptmp); modexShowPage(spri->page); } player.ty--; @@ -471,15 +479,13 @@ mapDrawCol(map_view_t *mv, int tx, int ty, word x) { } void -animatePlayer(map_view_t *src, map_view_t *dest, short d1, short d2, int x, int y, int ls, bitmap_t *bmp) +animatePlayer(map_view_t *src, map_view_t *dest, short d1, short d2, int x, int y, int ls, int lp, bitmap_t *bmp) { short dire=32*d1; short qq; - short lo = ((TILEWH / SPEED) / 3); - short loo = (ls + lo); if(d2==0) qq = 0; - else qq = ((ls)*SPEED); + else qq = ((lp)*SPEED); switch (d1) { case 0: diff --git a/scroll.exe b/scroll.exe index 110d9abd36ac3b5009b462a113dc3795b4395f3b..e8064a50cbf3619f665e5db88d04c21c8b3734bc 100644 GIT binary patch delta 4746 zcma)A3s@9Kwyvt~>1kfW$YVsnVL+IG-~)}Uhz$4|jL{83d_-Meo6W;TZ=wv`Z$D*l zXNgoANcO9Z*_hqUa&fO4b8oH&bGHRoCrrZlNL)dqM2#W7($M%=$t4C1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