From: sparky4 Date: Sun, 23 Nov 2014 19:24:58 +0000 (-0600) Subject: modified: 16/modex16/scroll.c X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=f90a79d1d9dcb5994352f90511575e957d207f2a;p=16.git modified: 16/modex16/scroll.c modified: 16/modex16/scroll.exe modified: scroll.c modified: scroll.exe --- diff --git a/16/modex16/scroll.c b/16/modex16/scroll.c index 03d4b2c8..78733026 100644 --- a/16/modex16/scroll.c +++ b/16/modex16/scroll.c @@ -116,7 +116,7 @@ void main() { //TODO: render the player properly with animation and sprite sheet if(keyp(77)) { -// modexDrawSpriteRegion(draw->page, player.x-4, player.y-TILEWH, 24, 32, 24, 32, &ptmp); + modexDrawSpriteRegion(draw->page, player.x-4, player.y-TILEWH, 24, 32, 24, 32, &ptmp); if(draw->tx >= 0 && draw->tx+20 < MAPX && player.tx == draw->tx + 10) { for(q=0; q<(TILEWH/SPEED); q++) @@ -138,7 +138,7 @@ void main() { // modexDrawBmp(draw->page, player.x, player.y, &bmp); animatePlayer(draw, 1, 0, player.x, player.y, q, &ptmp); modexShowPage(draw->page); - SWAP(draw, show); +// SWAP(draw, show); } player.tx++; } @@ -146,7 +146,7 @@ void main() { if(keyp(75)) { -// modexDrawSpriteRegion(draw->page, player.x-4, player.y-TILEWH, 24, 96, 24, 32, &ptmp); + modexDrawSpriteRegion(draw->page, player.x-4, player.y-TILEWH, 24, 96, 24, 32, &ptmp); if(draw->tx > 0 && draw->tx+20 <= MAPX && player.tx == draw->tx + 10) { for(q=0; q<(TILEWH/SPEED); q++) @@ -168,7 +168,7 @@ void main() { // modexDrawBmp(draw->page, player.x, player.y, &bmp); animatePlayer(draw, 3, 0, player.x, player.y, q, &ptmp); modexShowPage(draw->page); - SWAP(draw, show); +// SWAP(draw, show); } player.tx--; } @@ -176,7 +176,7 @@ void main() { 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) { for(q=0; q<(TILEWH/SPEED); q++) @@ -206,6 +206,7 @@ void main() { if(keyp(72)) { + modexDrawSpriteRegion(draw->page, player.x-4, player.y-TILEWH, 24, 0, 24, 32, &ptmp); if(draw->ty > 0 && draw->ty+15 <= MAPY && player.ty == draw->ty + 8) { for(q=0; q<(TILEWH/SPEED); q++) @@ -477,30 +478,30 @@ void animatePlayer(map_view_t *mv, short d1, short d2, int x, int y, int ls, bit case 0: //up if(ls<2) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp); - if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 0, 0, 24, 32, bmp); - if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 48, 0, 24, 32, bmp); + if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 48, 0, 24, 32, bmp); + if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 0, 0, 24, 32, bmp); if(ls>6) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp); break; case 1: // right //right if(ls<2) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp); - if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 0, 32, 24, 32, bmp); - if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 48, 32, 24, 32, bmp); + if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 48, 32, 24, 32, bmp); + if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 0, 32, 24, 32, bmp); if(ls>6) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp); break; case 2: //down if(ls<2) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp); - if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 0, 64, 24, 32, bmp); - if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 48, 64, 24, 32, bmp); + if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 48, 64, 24, 32, bmp); + if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 0, 64, 24, 32, bmp); if(ls>6) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp); break; case 3: //left if(ls<2) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp); - if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 0, 96, 24, 32, bmp); - if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 48, 96, 24, 32, bmp); + if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 48, 96, 24, 32, bmp); + if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 0, 96, 24, 32, bmp); if(ls>6) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp); break; } diff --git a/16/modex16/scroll.exe b/16/modex16/scroll.exe index 9ad1236c..fcf55ffd 100755 Binary files a/16/modex16/scroll.exe and b/16/modex16/scroll.exe differ diff --git a/scroll.c b/scroll.c index 03d4b2c8..78733026 100644 --- a/scroll.c +++ b/scroll.c @@ -116,7 +116,7 @@ void main() { //TODO: render the player properly with animation and sprite sheet if(keyp(77)) { -// modexDrawSpriteRegion(draw->page, player.x-4, player.y-TILEWH, 24, 32, 24, 32, &ptmp); + modexDrawSpriteRegion(draw->page, player.x-4, player.y-TILEWH, 24, 32, 24, 32, &ptmp); if(draw->tx >= 0 && draw->tx+20 < MAPX && player.tx == draw->tx + 10) { for(q=0; q<(TILEWH/SPEED); q++) @@ -138,7 +138,7 @@ void main() { // modexDrawBmp(draw->page, player.x, player.y, &bmp); animatePlayer(draw, 1, 0, player.x, player.y, q, &ptmp); modexShowPage(draw->page); - SWAP(draw, show); +// SWAP(draw, show); } player.tx++; } @@ -146,7 +146,7 @@ void main() { if(keyp(75)) { -// modexDrawSpriteRegion(draw->page, player.x-4, player.y-TILEWH, 24, 96, 24, 32, &ptmp); + modexDrawSpriteRegion(draw->page, player.x-4, player.y-TILEWH, 24, 96, 24, 32, &ptmp); if(draw->tx > 0 && draw->tx+20 <= MAPX && player.tx == draw->tx + 10) { for(q=0; q<(TILEWH/SPEED); q++) @@ -168,7 +168,7 @@ void main() { // modexDrawBmp(draw->page, player.x, player.y, &bmp); animatePlayer(draw, 3, 0, player.x, player.y, q, &ptmp); modexShowPage(draw->page); - SWAP(draw, show); +// SWAP(draw, show); } player.tx--; } @@ -176,7 +176,7 @@ void main() { 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) { for(q=0; q<(TILEWH/SPEED); q++) @@ -206,6 +206,7 @@ void main() { if(keyp(72)) { + modexDrawSpriteRegion(draw->page, player.x-4, player.y-TILEWH, 24, 0, 24, 32, &ptmp); if(draw->ty > 0 && draw->ty+15 <= MAPY && player.ty == draw->ty + 8) { for(q=0; q<(TILEWH/SPEED); q++) @@ -477,30 +478,30 @@ void animatePlayer(map_view_t *mv, short d1, short d2, int x, int y, int ls, bit case 0: //up if(ls<2) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp); - if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 0, 0, 24, 32, bmp); - if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 48, 0, 24, 32, bmp); + if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 48, 0, 24, 32, bmp); + if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 0, 0, 24, 32, bmp); if(ls>6) modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp); break; case 1: // right //right if(ls<2) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp); - if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 0, 32, 24, 32, bmp); - if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 48, 32, 24, 32, bmp); + if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 48, 32, 24, 32, bmp); + if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 0, 32, 24, 32, bmp); if(ls>6) modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp); break; case 2: //down if(ls<2) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp); - if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 0, 64, 24, 32, bmp); - if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 48, 64, 24, 32, bmp); + if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 48, 64, 24, 32, bmp); + if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 0, 64, 24, 32, bmp); if(ls>6) modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp); break; case 3: //left if(ls<2) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp); - if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 0, 96, 24, 32, bmp); - if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 48, 96, 24, 32, bmp); + if(4>ls && ls>=2) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 48, 96, 24, 32, bmp); + if(6>ls && ls>=4) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 0, 96, 24, 32, bmp); if(ls>6) modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp); break; } diff --git a/scroll.exe b/scroll.exe index 9ad1236c..fcf55ffd 100644 Binary files a/scroll.exe and b/scroll.exe differ