- int graphic = IMG_EXPLOSION;
- int frame = (phase / delay - 1);
-
- if (game.emulation == EMU_SUPAPLEX)
- graphic = (Store[x][y] == EL_SP_INFOTRON ?
- IMG_SP_EXPLOSION_INFOTRON :
- IMG_SP_EXPLOSION);
+ int stored = Store[x][y];
+ int graphic = (game.emulation != EMU_SUPAPLEX ? IMG_EXPLOSION :
+ stored == EL_SP_INFOTRON ? IMG_SP_EXPLOSION_INFOTRON :
+ IMG_SP_EXPLOSION);
+ int frame = getGraphicAnimationFrame(graphic, phase - delay);
- int left_dx = move_xy[left_dir].x, left_dy = move_xy[left_dir].y;
- int right_dx = move_xy[right_dir].x, right_dy = move_xy[right_dir].y;
- int move_dx = move_xy[old_move_dir].x, move_dy = move_xy[old_move_dir].y;
- int back_dx = move_xy[back_dir].x, back_dy = move_xy[back_dir].y;
+ int left_dx = move_xy[left_dir].x, left_dy = move_xy[left_dir].y;
+ int right_dx = move_xy[right_dir].x, right_dy = move_xy[right_dir].y;
+ int move_dx = move_xy[old_move_dir].x, move_dy = move_xy[old_move_dir].y;
+ int back_dx = move_xy[back_dir].x, back_dy = move_xy[back_dir].y;
- int left_x = x+left_dx, left_y = y+left_dy;
- int right_x = x+right_dx, right_y = y+right_dy;
- int move_x = x+move_dx, move_y = y+move_dy;
+ int left_x = x + left_dx, left_y = y + left_dy;
+ int right_x = x + right_dx, right_y = y + right_dy;
+ int move_x = x + move_dx, move_y = y + move_dy;
- if (!IN_LEV_FIELD(move_x, move_y) || !IS_FREE(move_x, move_y) ||
- (IN_LEV_FIELD(x, y+1) && IS_FREE(x, y+1)))
- {
- Feld[x][y] = EL_SPRING;
+ if ((MovDir[x][y] == MV_LEFT || MovDir[x][y] == MV_RIGHT) &&
+ (!IN_LEV_FIELD(move_x, move_y) || !IS_FREE(move_x, move_y) ||
+ (IN_LEV_FIELD(x, y + 1) && IS_FREE(x, y + 1))))
if (!MovDelay[x][y]) /* start new movement phase */
{
/* all objects that can change their move direction after each step */
/* (MAMPFER, MAMPFER2 and PACMAN go straight until they hit a wall */
if (!MovDelay[x][y]) /* start new movement phase */
{
/* all objects that can change their move direction after each step */
/* (MAMPFER, MAMPFER2 and PACMAN go straight until they hit a wall */
if (MovDelay[x][y] && (element == EL_BUG ||
element == EL_SPACESHIP ||
element == EL_SP_SNIKSNAK ||
if (MovDelay[x][y] && (element == EL_BUG ||
element == EL_SPACESHIP ||
element == EL_SP_SNIKSNAK ||
int direction = MovDir[x][y];
int dx = (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0);
int dy = (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0);
int direction = MovDir[x][y];
int dx = (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0);
int dy = (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0);
int newx = x + dx, newy = y + dy;
int step = (horiz_move ? dx : dy) * TILEX / 8;
int newx = x + dx, newy = y + dy;
int step = (horiz_move ? dx : dy) * TILEX / 8;
GfxAction[newx][newy] = GfxAction[x][y]; /* keep action one frame */
GfxAction[x][y] = GFX_ACTION_DEFAULT;
GfxAction[newx][newy] = GfxAction[x][y]; /* keep action one frame */
GfxAction[x][y] = GFX_ACTION_DEFAULT;
DrawGraphic(SCREENX(x), SCREENY(y), IMG_ROBOT_WHEEL_ACTIVE, frame);
}
DrawGraphic(SCREENX(x), SCREENY(y), IMG_ROBOT_WHEEL_ACTIVE, frame);
}
- if (!(MovDelay[x][y]%4))
- PlaySoundLevel(x, y, SND_ROBOT_WHEEL_ACTIVE);
+ PlaySoundLevel(x, y, SND_ROBOT_WHEEL_ACTIVE);
+
DrawGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_SWITCH_ACTIVE, frame);
}
DrawGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_SWITCH_ACTIVE, frame);
}
- if (!(MovDelay[x][y]%4))
- PlaySoundLevel(x, y, SND_TIMEGATE_SWITCH_ACTIVE);
+ PlaySoundLevel(x, y, SND_TIMEGATE_SWITCH_ACTIVE);
+
void NussKnacken(int x, int y)
{
if (!MovDelay[x][y]) /* next animation frame */
void NussKnacken(int x, int y)
{
if (!MovDelay[x][y]) /* next animation frame */
- int frame = getGraphicAnimationFrame(IMG_NUT_CRACKING,
- 6 - MovDelay[x][y]);
+ if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+ {
+ int frame = getGraphicAnimationFrame(IMG_NUT_CRACKING,
+ 6 - MovDelay[x][y]);
- DrawGraphic(SCREENX(x), SCREENY(y), IMG_NUT_CRACKING, frame);
- }
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_NUT_CRACKING, frame);
+ }
- int frame = getGraphicAnimationFrame(IMG_PEARL_BREAKING,
- 8 - MovDelay[x][y]);
+ if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+ {
+ int frame = getGraphicAnimationFrame(IMG_PEARL_BREAKING,
+ 8 - MovDelay[x][y]);
- DrawGraphic(SCREENX(x), SCREENY(y), IMG_PEARL_BREAKING, frame);
- }
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_PEARL_BREAKING, frame);
+ }
- tuer = MovDelay[x][y]/delay;
- if (!(MovDelay[x][y]%delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+ tuer = MovDelay[x][y] / delay;
+
+ if (!(MovDelay[x][y] % delay))
- int frame = getGraphicAnimationFrame(IMG_EXIT_OPENING,
- 29 - MovDelay[x][y]);
+ if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+ {
+ int frame = getGraphicAnimationFrame(IMG_EXIT_OPENING,
+ 29 - MovDelay[x][y]);
- DrawGraphic(SCREENX(x), SCREENY(y), IMG_EXIT_OPENING, frame);
- }
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_EXIT_OPENING, frame);
+ }
-void AusgangstuerBlinken(int x, int y)
-{
- DrawGraphicAnimation(x, y, IMG_EXIT_OPEN);
+ Feld[x][y] = EL_EXIT_OPEN;
+ DrawLevelField(x, y);
- int frame = getGraphicAnimationFrame(IMG_SWITCHGATE_OPENING,
- 29 - MovDelay[x][y]);
+ if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+ {
+ int frame = getGraphicAnimationFrame(IMG_SWITCHGATE_OPENING,
+ 29 - MovDelay[x][y]);
- DrawGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_OPENING, frame);
- }
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_OPENING, frame);
+ }
- int frame = getGraphicAnimationFrame(IMG_SWITCHGATE_CLOSING,
- 29 - MovDelay[x][y]);
+ if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+ {
+ int frame = getGraphicAnimationFrame(IMG_SWITCHGATE_CLOSING,
+ 29 - MovDelay[x][y]);
- DrawGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_CLOSING, frame);
- }
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_CLOSING, frame);
+ }
- int frame = getGraphicAnimationFrame(IMG_TIMEGATE_OPENING,
- 29 - MovDelay[x][y]);
+ if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+ {
+ int frame = getGraphicAnimationFrame(IMG_TIMEGATE_OPENING,
+ 29 - MovDelay[x][y]);
- DrawGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_OPENING, frame);
- }
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_OPENING, frame);
+ }
- int frame = getGraphicAnimationFrame(IMG_TIMEGATE_CLOSING,
- 29 - MovDelay[x][y]);
+ if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+ {
+ int frame = getGraphicAnimationFrame(IMG_TIMEGATE_CLOSING,
+ 29 - MovDelay[x][y]);
- DrawGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_CLOSING, frame);
- }
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_CLOSING, frame);
+ }
else if (element == EL_EXIT_OPENING)
AusgangstuerOeffnen(x, y);
else if (element == EL_EXIT_OPEN)
else if (element == EL_EXIT_OPENING)
AusgangstuerOeffnen(x, y);
else if (element == EL_EXIT_OPEN)
else if (element == EL_SP_TERMINAL)
DrawGraphicAnimation(x, y, IMG_SP_TERMINAL);
else if (element == EL_SP_TERMINAL_ACTIVE)
else if (element == EL_SP_TERMINAL)
DrawGraphicAnimation(x, y, IMG_SP_TERMINAL);
else if (element == EL_SP_TERMINAL_ACTIVE)
else if (IS_BELT_ACTIVE(element))
DrawBeltAnimation(x, y, element);
else if (element == EL_SWITCHGATE_OPENING)
else if (IS_BELT_ACTIVE(element))
DrawBeltAnimation(x, y, element);
else if (element == EL_SWITCHGATE_OPENING)
else if (element == EL_EXTRA_TIME)
DrawGraphicAnimation(x, y, IMG_EXTRA_TIME);
else if (element == EL_SHIELD_NORMAL)
else if (element == EL_EXTRA_TIME)
DrawGraphicAnimation(x, y, IMG_EXTRA_TIME);
else if (element == EL_SHIELD_NORMAL)