X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=73fca1bdbf98ce201d96d4b8d1d968a0dc55ba1f;hb=e1e1f0e96140865d39f667f6af11ebec5e8c9cad;hp=eb64c053d27d23f99731ebf76662efa253c5cfa3;hpb=aaef409525599bb87a6dc8c099fbc0e11a455bae;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index eb64c053..73fca1bd 100644 --- a/src/game.c +++ b/src/game.c @@ -1008,6 +1008,13 @@ void Impact(int x, int y) break; case EL_FELSBROCKEN: sound = SND_KLOPF; + + + + printf("FUMPF!\n"); + + + break; case EL_SCHLUESSEL: case EL_SCHLUESSEL1: @@ -2581,15 +2588,12 @@ void GameActions() */ - if (PlayerMovPos) ScrollFigure(0); DrawPlayerField(); - - if (!DelayReached(&action_delay, action_delay_value)) return; @@ -2781,7 +2785,7 @@ void ScrollLevel(int dx, int dy) BOOL MoveFigureOneStep(int dx, int dy, int real_dx, int real_dy) { - int oldJX,oldJY, newJX = JX+dx,newJY = JY+dy; + int newJX = JX+dx, newJY = JY+dy; int element; int can_move; @@ -2819,30 +2823,15 @@ BOOL MoveFigureOneStep(int dx, int dy, int real_dx, int real_dy) if (can_move != MF_MOVING) return(can_move); - oldJX = JX; - oldJY = JY; + lastJX = JX; + lastJY = JY; JX = newJX; JY = newJY; - - lastJX = oldJX; - lastJY = oldJY; - PlayerMovPos = (dx > 0 || dy > 0 ? -1 : 1) * 3*TILEX/4; ScrollFigure(-1); - if (Store[oldJX][oldJY]) - { - DrawGraphic(SCROLLX(oldJX),SCROLLY(oldJY),el2gfx(Store[oldJX][oldJY])); - DrawGraphicThruMask(SCROLLX(oldJX),SCROLLY(oldJY), - el2gfx(Feld[oldJX][oldJY])); - } - else if (Feld[oldJX][oldJY]==EL_DYNAMIT) - DrawDynamite(oldJX,oldJY); - else - DrawLevelField(oldJX,oldJY); - return(MF_MOVING); } @@ -2882,18 +2871,18 @@ BOOL MoveFigure(int dx, int dy) if (moved & MF_MOVING) { - int old_scroll_x=scroll_x, old_scroll_y=scroll_y; + int old_scroll_x = scroll_x, old_scroll_y = scroll_y; int offset = (scroll_delay_on ? 3 : 0); if ((scroll_x < JX-MIDPOSX-offset || scroll_x > JX-MIDPOSX+offset) && - JX>=MIDPOSX-1-offset && JX<=lev_fieldx-(MIDPOSX-offset)) + JX >= MIDPOSX-1-offset && JX <= lev_fieldx-(MIDPOSX-offset)) scroll_x = JX-MIDPOSX + (scroll_x < JX-MIDPOSX ? -offset : offset); if ((scroll_y < JY-MIDPOSY-offset || scroll_y > JY-MIDPOSY+offset) && - JY>=MIDPOSY-1-offset && JY<=lev_fieldy-(MIDPOSY-offset)) + JY >= MIDPOSY-1-offset && JY <= lev_fieldy-(MIDPOSY-offset)) scroll_y = JY-MIDPOSY + (scroll_y < JY-MIDPOSY ? -offset : offset); - if (scroll_x!=old_scroll_x || scroll_y!=old_scroll_y) - ScrollLevel(old_scroll_x-scroll_x,old_scroll_y-scroll_y); + if (scroll_x != old_scroll_x || scroll_y != old_scroll_y) + ScrollLevel(old_scroll_x - scroll_x, old_scroll_y - scroll_y); } if (!(moved & MF_MOVING) && !PlayerPushing) @@ -2931,7 +2920,9 @@ void ScrollFigure(int init) if (oldJX != -1 && oldJY != -1) DrawLevelElement(oldJX,oldJY, Feld[oldJX][oldJY]); - if (Feld[lastJX][lastJY] == EL_LEERRAUM) + if (Feld[lastJX][lastJY] == EL_LEERRAUM && + IN_LEV_FIELD(lastJX,lastJY-1) && + CAN_FALL(Feld[lastJX][lastJY-1])) Feld[lastJX][lastJY] = EL_PLAYER_IS_LEAVING; DrawLevelElement(lastJX,lastJY, Feld[lastJX][lastJY]); DrawPlayerField(); @@ -2953,6 +2944,18 @@ void ScrollFigure(int init) DrawPlayerField(); + if (Store[lastJX][lastJY]) + { + DrawGraphic(SCROLLX(lastJX),SCROLLY(lastJY), + el2gfx(Store[lastJX][lastJY])); + DrawGraphicThruMask(SCROLLX(lastJX),SCROLLY(lastJY), + el2gfx(Feld[lastJX][lastJY])); + } + else if (Feld[lastJX][lastJY]==EL_DYNAMIT) + DrawDynamite(lastJX,lastJY); + else + DrawLevelField(lastJX,lastJY); + return; } else if (!FrameReached(&actual_frame_counter,1))