From: Holger Schemel Date: Wed, 22 Jan 2020 23:08:55 +0000 (+0100) Subject: swapped x and y dimensions in EM engine cave arrays X-Git-Tag: 4.2.0.0~179 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=b5e34de2d22082ce3c719d7502d998cfc6f2306d;p=rocksndiamonds.git swapped x and y dimensions in EM engine cave arrays --- diff --git a/src/game_em/convert.c b/src/game_em/convert.c index d009b740..70ca9f80 100644 --- a/src/game_em/convert.c +++ b/src/game_em/convert.c @@ -940,15 +940,15 @@ void prepare_em_level(void) for (y = 0; y < HEIGHT; y++) for (x = 0; x < WIDTH; x++) - Cave[y][x] = native_em_level.cave[x][y]; + Cave[x][y] = native_em_level.cave[x][y]; for (y = 0; y < HEIGHT; y++) for (x = 0; x < WIDTH; x++) - Next[y][x] = Cave[y][x]; + Next[x][y] = Cave[x][y]; for (y = 0; y < HEIGHT; y++) for (x = 0; x < WIDTH; x++) - Draw[y][x] = Cave[y][x]; + Draw[x][y] = Cave[x][y]; lev.time_initial = lev.time_seconds; lev.time = lev.time_initial; @@ -1021,7 +1021,7 @@ void prepare_em_level(void) native_em_level.cave[x][y] = Xblank; - Cave[y][x] = Next[y][x] = Draw[y][x] = Xblank; + Cave[x][y] = Next[x][y] = Draw[x][y] = Xblank; } } } diff --git a/src/game_em/export.h b/src/game_em/export.h index 5c9864a6..550110c0 100644 --- a/src/game_em/export.h +++ b/src/game_em/export.h @@ -70,7 +70,7 @@ struct EngineSnapshotInfo_EM unsigned int RandomEM; struct LEVEL lev; struct PLAYER ply[MAX_PLAYERS]; - short Array[4][EM_MAX_CAVE_HEIGHT][EM_MAX_CAVE_WIDTH]; + short Array[4][EM_MAX_CAVE_WIDTH][EM_MAX_CAVE_HEIGHT]; int screen_x; int screen_y; int frame; diff --git a/src/game_em/graphics.c b/src/game_em/graphics.c index 7a88ecf7..1ba8c511 100644 --- a/src/game_em/graphics.c +++ b/src/game_em/graphics.c @@ -34,8 +34,8 @@ int frame; /* current screen frame */ int screen_x, screen_y; /* current scroll position */ /* tiles currently on screen */ -static int screentiles[MAX_PLAYFIELD_HEIGHT + 2][MAX_PLAYFIELD_WIDTH + 2]; -static int crumbled_state[MAX_PLAYFIELD_HEIGHT + 2][MAX_PLAYFIELD_WIDTH + 2]; +static int screentiles[MAX_PLAYFIELD_WIDTH + 2][MAX_PLAYFIELD_HEIGHT + 2]; +static int crumbled_state[MAX_PLAYFIELD_WIDTH + 2][MAX_PLAYFIELD_HEIGHT + 2]; int getFieldbufferOffsetX_EM(void) { @@ -109,7 +109,7 @@ void BackToFront_EM(void) static struct GraphicInfo_EM *getObjectGraphic(int x, int y) { - int tile = Draw[y][x]; + int tile = Draw[x][y]; struct GraphicInfo_EM *g = &graphic_info_em_object[tile][frame]; if (!game.use_native_emc_graphics_engine) @@ -302,8 +302,8 @@ static void animscreen(void) if (!game.use_native_emc_graphics_engine) for (y = 2; y < EM_MAX_CAVE_HEIGHT - 2; y++) for (x = 2; x < EM_MAX_CAVE_WIDTH - 2; x++) - SetGfxAnimation_EM(&graphic_info_em_object[Draw[y][x]][frame], - Draw[y][x], 7 - frame, x - 2, y - 2); + SetGfxAnimation_EM(&graphic_info_em_object[Draw[x][y]][frame], + Draw[x][y], 7 - frame, x - 2, y - 2); for (y = top; y < top + MAX_BUF_YSIZE; y++) { @@ -311,7 +311,7 @@ static void animscreen(void) { int sx = x % MAX_BUF_XSIZE; int sy = y % MAX_BUF_YSIZE; - int tile = Draw[y][x]; + int tile = Draw[x][y]; struct GraphicInfo_EM *g = &graphic_info_em_object[tile][frame]; int obj = g->unique_identifier; int crm = 0; @@ -330,15 +330,15 @@ static void animscreen(void) yy < 0 || yy >= EM_MAX_CAVE_HEIGHT) continue; - tile_next = Draw[yy][xx]; + tile_next = Draw[xx][yy]; if (!graphic_info_em_object[tile_next][frame].has_crumbled_graphics) crm |= (1 << i); } } - redraw_screen_tile = (screentiles[sy][sx] != obj || - crumbled_state[sy][sx] != crm); + redraw_screen_tile = (screentiles[sx][sy] != obj || + crumbled_state[sx][sy] != crm); /* only redraw screen tiles if they (or their crumbled state) changed */ if (redraw_screen_tile) @@ -346,8 +346,8 @@ static void animscreen(void) DrawLevelField_EM(x, y, sx, sy, FALSE); DrawLevelFieldCrumbled_EM(x, y, sx, sy, crm, FALSE); - screentiles[sy][sx] = obj; - crumbled_state[sy][sx] = crm; + screentiles[sx][sy] = obj; + crumbled_state[sx][sy] = crm; } } } @@ -386,7 +386,7 @@ static void blitplayer(struct PLAYER *ply) int old_sy = old_y % MAX_BUF_YSIZE; int new_sx = new_x % MAX_BUF_XSIZE; int new_sy = new_y % MAX_BUF_YSIZE; - int new_crm = crumbled_state[new_sy][new_sx]; + int new_crm = crumbled_state[new_sx][new_sy]; /* only diggable elements can be crumbled in the classic EM engine */ boolean player_is_digging = (new_crm != 0); @@ -416,8 +416,8 @@ static void blitplayer(struct PLAYER *ply) } /* redraw screen tiles in the next frame (player may have left the tiles) */ - screentiles[old_sy][old_sx] = -1; - screentiles[new_sy][new_sx] = -1; + screentiles[old_sx][old_sy] = -1; + screentiles[new_sx][new_sy] = -1; } } @@ -437,8 +437,8 @@ void game_initscreen(void) { for (x = 0; x < MAX_BUF_XSIZE; x++) { - screentiles[y][x] = -1; - crumbled_state[y][x] = 0; + screentiles[x][y] = -1; + crumbled_state[x][y] = 0; } } } @@ -691,8 +691,8 @@ void RedrawPlayfield_EM(boolean force_redraw) { for (x = 0; x < MAX_BUF_XSIZE; x++) { - screentiles[y][x] = -1; - crumbled_state[y][x] = 0; + screentiles[x][y] = -1; + crumbled_state[x][y] = 0; } } } diff --git a/src/game_em/input.c b/src/game_em/input.c index e3e17cb8..27eb294f 100644 --- a/src/game_em/input.c +++ b/src/game_em/input.c @@ -16,8 +16,8 @@ short **Cave; short **Next; short **Draw; -static short *Index[4][HEIGHT]; -static short Array[4][HEIGHT][WIDTH]; +static short *Index[4][WIDTH]; +static short Array[4][WIDTH][HEIGHT]; extern int screen_x; extern int screen_y; @@ -32,25 +32,25 @@ void game_init_vars(void) for (y = 0; y < HEIGHT; y++) for (x = 0; x < WIDTH; x++) - Array[0][y][x] = Zborder; + Array[0][x][y] = Zborder; for (y = 0; y < HEIGHT; y++) for (x = 0; x < WIDTH; x++) - Array[1][y][x] = Zborder; + Array[1][x][y] = Zborder; for (y = 0; y < HEIGHT; y++) for (x = 0; x < WIDTH; x++) - Array[2][y][x] = Zborder; + Array[2][x][y] = Zborder; for (y = 0; y < HEIGHT; y++) for (x = 0; x < WIDTH; x++) - Array[3][y][x] = Xblank; + Array[3][x][y] = Xblank; - for (y = 0; y < HEIGHT; y++) - Index[0][y] = Array[0][y]; - for (y = 0; y < HEIGHT; y++) - Index[1][y] = Array[1][y]; - for (y = 0; y < HEIGHT; y++) - Index[2][y] = Array[2][y]; - for (y = 0; y < HEIGHT; y++) - Index[3][y] = Array[3][y]; + for (x = 0; x < WIDTH; x++) + Index[0][x] = Array[0][x]; + for (x = 0; x < WIDTH; x++) + Index[1][x] = Array[1][x]; + for (x = 0; x < WIDTH; x++) + Index[2][x] = Array[2][x]; + for (x = 0; x < WIDTH; x++) + Index[3][x] = Array[3][x]; Cave = Index[0]; Next = Index[1]; @@ -190,7 +190,7 @@ void SaveEngineSnapshotValues_EM(void) for (i = 0; i < 4; i++) for (j = 0; j < HEIGHT; j++) for (k = 0; k < WIDTH; k++) - engine_snapshot_em.Array[i][j][k] = Array[i][j][k]; + engine_snapshot_em.Array[i][k][j] = Array[i][k][j]; } void LoadEngineSnapshotValues_EM(void) @@ -217,5 +217,5 @@ void LoadEngineSnapshotValues_EM(void) for (i = 0; i < 4; i++) for (j = 0; j < HEIGHT; j++) for (k = 0; k < WIDTH; k++) - Array[i][j][k] = engine_snapshot_em.Array[i][j][k]; + Array[i][k][j] = engine_snapshot_em.Array[i][k][j]; } diff --git a/src/game_em/synchro_1.c b/src/game_em/synchro_1.c index dc713938..56d4c6ce 100644 --- a/src/game_em/synchro_1.c +++ b/src/game_em/synchro_1.c @@ -54,16 +54,16 @@ void synchro_1(void) if (!ply[i].alive) continue; - if (Cave[ply[i].oldy][ply[i].oldx] == Zplayer) + if (Cave[ply[i].oldx][ply[i].oldy] == Zplayer) { - Cave[ply[i].oldy][ply[i].oldx] = Xblank; - Next[ply[i].oldy][ply[i].oldx] = Xblank; + Cave[ply[i].oldx][ply[i].oldy] = Xblank; + Next[ply[i].oldx][ply[i].oldy] = Xblank; } - if (Cave[ply[i].y][ply[i].x] == Xblank) + if (Cave[ply[i].x][ply[i].y] == Xblank) { - Cave[ply[i].y][ply[i].x] = Zplayer; - Next[ply[i].y][ply[i].x] = Zplayer; + Cave[ply[i].x][ply[i].y] = Zplayer; + Next[ply[i].x][ply[i].y] = Zplayer; } } } @@ -79,7 +79,7 @@ static boolean player_killed(struct PLAYER *ply) if (lev.killed_out_of_time && setup.time_limit) return TRUE; - switch(Cave[y-1][x]) + switch(Cave[x][y-1]) { case Xbug_1_n: case Xbug_1_e: @@ -100,7 +100,7 @@ static boolean player_killed(struct PLAYER *ply) return TRUE; } - switch(Cave[y][x+1]) + switch(Cave[x+1][y]) { case Xbug_1_n: case Xbug_1_e: @@ -121,7 +121,7 @@ static boolean player_killed(struct PLAYER *ply) return TRUE; } - switch(Cave[y+1][x]) + switch(Cave[x][y+1]) { case Xbug_1_n: case Xbug_1_e: @@ -142,7 +142,7 @@ static boolean player_killed(struct PLAYER *ply) return TRUE; } - switch(Cave[y][x-1]) + switch(Cave[x-1][y]) { case Xbug_1_n: case Xbug_1_e: @@ -163,7 +163,7 @@ static boolean player_killed(struct PLAYER *ply) return TRUE; } - switch(Cave[y][x]) + switch(Cave[x][y]) { case Xblank: case Xacid_splash_e: @@ -196,7 +196,7 @@ static void kill_player(struct PLAYER *ply) ply->alive = 0; - switch(Cave[y-1][x]) + switch(Cave[x][y-1]) { case Xbug_1_n: case Xbug_1_e: @@ -206,7 +206,7 @@ static void kill_player(struct PLAYER *ply) case Xbug_2_e: case Xbug_2_s: case Xbug_2_w: - Cave[y-1][x] = Xboom_bug; + Cave[x][y-1] = Xboom_bug; break; case Xtank_1_n: @@ -217,11 +217,11 @@ static void kill_player(struct PLAYER *ply) case Xtank_2_e: case Xtank_2_s: case Xtank_2_w: - Cave[y-1][x] = Xboom_bomb; + Cave[x][y-1] = Xboom_bomb; break; } - switch(Cave[y][x+1]) + switch(Cave[x+1][y]) { case Xbug_1_n: case Xbug_1_e: @@ -231,7 +231,7 @@ static void kill_player(struct PLAYER *ply) case Xbug_2_e: case Xbug_2_s: case Xbug_2_w: - Cave[y][x+1] = Xboom_bug; + Cave[x+1][y] = Xboom_bug; break; case Xtank_1_n: @@ -242,11 +242,11 @@ static void kill_player(struct PLAYER *ply) case Xtank_2_e: case Xtank_2_s: case Xtank_2_w: - Cave[y][x+1] = Xboom_bomb; + Cave[x+1][y] = Xboom_bomb; break; } - switch(Cave[y+1][x]) + switch(Cave[x][y+1]) { case Xbug_1_n: case Xbug_1_e: @@ -256,7 +256,7 @@ static void kill_player(struct PLAYER *ply) case Xbug_2_e: case Xbug_2_s: case Xbug_2_w: - Cave[y+1][x] = Xboom_bug; + Cave[x][y+1] = Xboom_bug; break; case Xtank_1_n: @@ -267,11 +267,11 @@ static void kill_player(struct PLAYER *ply) case Xtank_2_e: case Xtank_2_s: case Xtank_2_w: - Cave[y+1][x] = Xboom_bomb; + Cave[x][y+1] = Xboom_bomb; break; } - switch(Cave[y][x-1]) + switch(Cave[x-1][y]) { case Xbug_1_n: case Xbug_1_e: @@ -281,7 +281,7 @@ static void kill_player(struct PLAYER *ply) case Xbug_2_e: case Xbug_2_s: case Xbug_2_w: - Cave[y][x-1] = Xboom_bug; + Cave[x-1][y] = Xboom_bug; break; case Xtank_1_n: @@ -292,11 +292,11 @@ static void kill_player(struct PLAYER *ply) case Xtank_2_e: case Xtank_2_s: case Xtank_2_w: - Cave[y][x-1] = Xboom_bomb; + Cave[x-1][y] = Xboom_bomb; break; } - switch(Cave[y][x]) + switch(Cave[x][y]) { case Xexit_1: case Xexit_2: @@ -311,7 +311,7 @@ static void kill_player(struct PLAYER *ply) break; } - switch(Cave[y][x]) + switch(Cave[x][y]) { #if USE_CHANGED_ACID_STUFF case Xacid_1: @@ -326,8 +326,8 @@ static void kill_player(struct PLAYER *ply) #endif default: - Cave[y][x] = Xboom_1; - Boom[y][x] = Xblank; + Cave[x][y] = Xboom_1; + Boom[x][y] = Xblank; break; } } @@ -410,7 +410,7 @@ static void check_player(struct PLAYER *ply) { if (++ply->dynamite_cnt == 5 && ply->dynamite) { - Cave[y][x] = Xdynamite_1; + Cave[x][y] = Xdynamite_1; play_element_sound(x, y, SOUND_dynamite, Xdynamite_1); ply->dynamite--; } @@ -480,16 +480,16 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) if (ply->joy_snap == 0) /* player wants to move */ { - int element = Cave[y][x]; + int element = Cave[x][y]; - switch(Cave[y][x]) + switch(Cave[x][y]) { /* fire is released */ case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Zplayer; - Next[y][x] = Zplayer; + Cave[x][y] = Zplayer; + Next[x][y] = Zplayer; #ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS case Xfake_acid_1: case Xfake_acid_2: @@ -515,10 +515,10 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) case Xacid_6: case Xacid_7: case Xacid_8: - if (Cave[y-1][x+1] == Xblank) - Cave[y-1][x+1] = Xacid_splash_e; - if (Cave[y-1][x-1] == Xblank) - Cave[y-1][x-1] = Xacid_splash_w; + if (Cave[x+1][y-1] == Xblank) + Cave[x+1][y-1] = Xacid_splash_e; + if (Cave[x-1][y-1] == Xblank) + Cave[x-1][y-1] = Xacid_splash_w; play_element_sound(x, y, SOUND_acid, Xacid_1); #endif @@ -557,9 +557,9 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) break; case Xgrass: - Cave[y][x] = (dy ? (dy < 0 ? Ygrass_nB : Ygrass_sB) : + Cave[x][y] = (dy ? (dy < 0 ? Ygrass_nB : Ygrass_sB) : (dx > 0 ? Ygrass_eB : Ygrass_wB)); - Next[y][x] = Zplayer; + Next[x][y] = Zplayer; play_element_sound(x, y, SOUND_dirt, Xgrass); ply->anim = PLY_walk_n + anim; ply->x = x; @@ -567,9 +567,9 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) break; case Xdirt: - Cave[y][x] = (dy ? (dy < 0 ? Ydirt_nB : Ydirt_sB) : + Cave[x][y] = (dy ? (dy < 0 ? Ydirt_nB : Ydirt_sB) : (dx > 0 ? Ydirt_eB : Ydirt_wB)); - Next[y][x] = Zplayer; + Next[x][y] = Zplayer; play_element_sound(x, y, SOUND_dirt, Xdirt); ply->anim = PLY_walk_n + anim; ply->x = x; @@ -578,8 +578,8 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) case Xdiamond: case Xdiamond_pause: - Cave[y][x] = Ydiamond_blank; - Next[y][x] = Zplayer; + Cave[x][y] = Ydiamond_blank; + Next[x][y] = Zplayer; play_element_sound(x, y, SOUND_collect, element); lev.score += lev.diamond_score; lev.required = lev.required < 3 ? 0 : lev.required - 3; @@ -591,8 +591,8 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) case Xemerald: case Xemerald_pause: - Cave[y][x] = Yemerald_blank; - Next[y][x] = Zplayer; + Cave[x][y] = Yemerald_blank; + Next[x][y] = Zplayer; play_element_sound(x, y, SOUND_collect, element); lev.score += lev.emerald_score; lev.required = lev.required < 1 ? 0 : lev.required - 1; @@ -603,8 +603,8 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) break; case Xdynamite: - Cave[y][x] = Ydynamite_blank; - Next[y][x] = Zplayer; + Cave[x][y] = Ydynamite_blank; + Next[x][y] = Zplayer; play_element_sound(x, y, SOUND_collect, element); lev.score += lev.dynamite_score; ply->dynamite = ply->dynamite > 9998 ? 9999 : ply->dynamite + 1; @@ -615,47 +615,47 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) case Xkey_1: ply->keys |= 0x01; - Cave[y][x] = Ykey_1_blank; + Cave[x][y] = Ykey_1_blank; goto key_walk; case Xkey_2: ply->keys |= 0x02; - Cave[y][x] = Ykey_2_blank; + Cave[x][y] = Ykey_2_blank; goto key_walk; case Xkey_3: ply->keys |= 0x04; - Cave[y][x] = Ykey_3_blank; + Cave[x][y] = Ykey_3_blank; goto key_walk; case Xkey_4: ply->keys |= 0x08; - Cave[y][x] = Ykey_4_blank; + Cave[x][y] = Ykey_4_blank; goto key_walk; case Xkey_5: ply->keys |= 0x10; - Cave[y][x] = Ykey_5_blank; + Cave[x][y] = Ykey_5_blank; goto key_walk; case Xkey_6: ply->keys |= 0x20; - Cave[y][x] = Ykey_6_blank; + Cave[x][y] = Ykey_6_blank; goto key_walk; case Xkey_7: ply->keys |= 0x40; - Cave[y][x] = Ykey_7_blank; + Cave[x][y] = Ykey_7_blank; goto key_walk; case Xkey_8: ply->keys |= 0x80; - Cave[y][x] = Ykey_8_blank; + Cave[x][y] = Ykey_8_blank; goto key_walk; key_walk: - Next[y][x] = Zplayer; + Next[x][y] = Zplayer; play_element_sound(x, y, SOUND_collect, element); lev.score += lev.key_score; ply->anim = PLY_walk_n + anim; @@ -664,8 +664,8 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) break; case Xlenses: - Cave[y][x] = Ylenses_blank; - Next[y][x] = Zplayer; + Cave[x][y] = Ylenses_blank; + Next[x][y] = Zplayer; play_element_sound(x, y, SOUND_collect, element); lev.score += lev.lenses_score; lev.lenses_cnt = lev.lenses_time; @@ -675,8 +675,8 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) break; case Xmagnify: - Cave[y][x] = Ymagnify_blank; - Next[y][x] = Zplayer; + Cave[x][y] = Ymagnify_blank; + Next[x][y] = Zplayer; play_element_sound(x, y, SOUND_collect, element); lev.score += lev.magnify_score; lev.magnify_cnt = lev.magnify_time; @@ -689,7 +689,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) if (dy) break; - switch(Cave[y][x+dx]) + switch(Cave[x+dx][y]) { case Xacid_1: case Xacid_2: @@ -699,23 +699,23 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) case Xacid_6: case Xacid_7: case Xacid_8: - if (Cave[y-1][x+dx+1] == Xblank) - Cave[y-1][x+dx+1] = Xacid_splash_e; - if (Cave[y-1][x+dx-1] == Xblank) - Cave[y-1][x+dx-1] = Xacid_splash_w; + if (Cave[x+dx+1][y-1] == Xblank) + Cave[x+dx+1][y-1] = Xacid_splash_e; + if (Cave[x+dx-1][y-1] == Xblank) + Cave[x+dx-1][y-1] = Xacid_splash_w; play_element_sound(x, y, SOUND_acid, Xacid_1); goto stone_walk; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x+dx] = dx > 0 ? Ystone_e : Ystone_w; - Next[y][x+dx] = Xstone_pause; + Cave[x+dx][y] = dx > 0 ? Ystone_e : Ystone_w; + Next[x+dx][y] = Xstone_pause; stone_walk: - Cave[y][x] = dx > 0 ? Ystone_eB : Ystone_wB; - Next[y][x] = Zplayer; + Cave[x][y] = dx > 0 ? Ystone_eB : Ystone_wB; + Next[x][y] = Zplayer; play_element_sound(x, y, SOUND_roll, Xstone); ply->x = x; } @@ -727,7 +727,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) if (dy) break; - switch(Cave[y][x+dx]) + switch(Cave[x+dx][y]) { case Xacid_1: case Xacid_2: @@ -737,23 +737,23 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) case Xacid_6: case Xacid_7: case Xacid_8: - if (Cave[y-1][x+dx+1] == Xblank) - Cave[y-1][x+dx+1] = Xacid_splash_e; - if (Cave[y-1][x+dx-1] == Xblank) - Cave[y-1][x+dx-1] = Xacid_splash_w; + if (Cave[x+dx+1][y-1] == Xblank) + Cave[x+dx+1][y-1] = Xacid_splash_e; + if (Cave[x+dx-1][y-1] == Xblank) + Cave[x+dx-1][y-1] = Xacid_splash_w; play_element_sound(x, y, SOUND_acid, Xacid_1); goto bomb_walk; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x+dx] = dx > 0 ? Ybomb_e : Ybomb_w; - Next[y][x+dx] = Xbomb_pause; + Cave[x+dx][y] = dx > 0 ? Ybomb_e : Ybomb_w; + Next[x+dx][y] = Xbomb_pause; bomb_walk: - Cave[y][x] = dx > 0 ? Ybomb_eB : Ybomb_wB; - Next[y][x] = Zplayer; + Cave[x][y] = dx > 0 ? Ybomb_eB : Ybomb_wB; + Next[x][y] = Zplayer; play_element_sound(x, y, SOUND_roll, Xbomb); ply->x = x; } @@ -765,7 +765,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) if (dy) break; - switch(Cave[y][x+dx]) + switch(Cave[x+dx][y]) { case Xacid_1: case Xacid_2: @@ -775,23 +775,23 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) case Xacid_6: case Xacid_7: case Xacid_8: - if (Cave[y-1][x+dx+1] == Xblank) - Cave[y-1][x+dx+1] = Xacid_splash_e; - if (Cave[y-1][x+dx-1] == Xblank) - Cave[y-1][x+dx-1] = Xacid_splash_w; + if (Cave[x+dx+1][y-1] == Xblank) + Cave[x+dx+1][y-1] = Xacid_splash_e; + if (Cave[x+dx-1][y-1] == Xblank) + Cave[x+dx-1][y-1] = Xacid_splash_w; play_element_sound(x, y, SOUND_acid, Xacid_1); goto nut_walk; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x+dx] = dx > 0 ? Ynut_e : Ynut_w; - Next[y][x+dx] = Xnut_pause; + Cave[x+dx][y] = dx > 0 ? Ynut_e : Ynut_w; + Next[x+dx][y] = Xnut_pause; nut_walk: - Cave[y][x] = dx > 0 ? Ynut_eB : Ynut_wB; - Next[y][x] = Zplayer; + Cave[x][y] = dx > 0 ? Ynut_eB : Ynut_wB; + Next[x][y] = Zplayer; play_element_sound(x, y, SOUND_roll, Xnut); ply->x = x; } @@ -803,14 +803,14 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) if (dy) break; - switch(Cave[y][x+dx]) + switch(Cave[x+dx][y]) { case Xalien: case Xalien_pause: - Cave[y][x] = dx > 0 ? Yspring_alien_eB : Yspring_alien_wB; - Cave[y][x+dx] = dx > 0 ? Yspring_alien_e : Yspring_alien_w; - Next[y][x] = Zplayer; - Next[y][x+dx] = dx > 0 ? Xspring_e : Xspring_w; + Cave[x][y] = dx > 0 ? Yspring_alien_eB : Yspring_alien_wB; + Cave[x+dx][y] = dx > 0 ? Yspring_alien_e : Yspring_alien_w; + Next[x][y] = Zplayer; + Next[x+dx][y] = dx > 0 ? Xspring_e : Xspring_w; play_element_sound(x, y, SOUND_slurp, Xalien); lev.score += lev.slurp_score; ply->x = x; @@ -824,22 +824,22 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) case Xacid_6: case Xacid_7: case Xacid_8: - if (Cave[y-1][x+dx+1] == Xblank) - Cave[y-1][x+dx+1] = Xacid_splash_e; - if (Cave[y-1][x+dx-1] == Xblank) - Cave[y-1][x+dx-1] = Xacid_splash_w; + if (Cave[x+dx+1][y-1] == Xblank) + Cave[x+dx+1][y-1] = Xacid_splash_e; + if (Cave[x+dx-1][y-1] == Xblank) + Cave[x+dx-1][y-1] = Xacid_splash_w; play_element_sound(x, y, SOUND_acid, Xacid_1); goto spring_walk; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x+dx] = dx > 0 ? Yspring_e : Yspring_w; - Next[y][x+dx] = dx > 0 ? Xspring_e : Xspring_w; + Cave[x+dx][y] = dx > 0 ? Yspring_e : Yspring_w; + Next[x+dx][y] = dx > 0 ? Xspring_e : Xspring_w; spring_walk: - Cave[y][x] = dx > 0 ? Yspring_eB : Yspring_wB; - Next[y][x] = Zplayer; + Cave[x][y] = dx > 0 ? Yspring_eB : Yspring_wB; + Next[x][y] = Zplayer; play_element_sound(x, y, SOUND_roll, Xspring); ply->x = x; } @@ -862,7 +862,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) break; case Xballoon: - switch(Cave[y+dy][x+dx]) + switch(Cave[x+dx][y+dy]) { case Xacid_1: case Xacid_2: @@ -872,24 +872,24 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) case Xacid_6: case Xacid_7: case Xacid_8: - if (Cave[y+dy-1][x+dx+1] == Xblank) - Cave[y+dy-1][x+dx+1] = Xacid_splash_e; - if (Cave[y+dy-1][x+dx-1] == Xblank) - Cave[y+dy-1][x+dx-1] = Xacid_splash_w; + if (Cave[x+dx+1][y+dy-1] == Xblank) + Cave[x+dx+1][y+dy-1] = Xacid_splash_e; + if (Cave[x+dx-1][y+dy-1] == Xblank) + Cave[x+dx-1][y+dy-1] = Xacid_splash_w; play_element_sound(x, y, SOUND_acid, Xacid_1); goto balloon_walk; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y+dy][x+dx] = (dy ? (dy < 0 ? Yballoon_n : Yballoon_s) : + Cave[x+dx][y+dy] = (dy ? (dy < 0 ? Yballoon_n : Yballoon_s) : (dx > 0 ? Yballoon_e : Yballoon_w)); - Next[y+dy][x+dx] = Xballoon; + Next[x+dx][y+dy] = Xballoon; balloon_walk: - Cave[y][x] = (dy ? (dy < 0 ? Yballoon_nB : Yballoon_sB) : + Cave[x][y] = (dy ? (dy < 0 ? Yballoon_nB : Yballoon_sB) : (dx > 0 ? Yballoon_eB : Yballoon_wB)); - Next[y][x] = Zplayer; + Next[x][y] = Zplayer; play_element_sound(x, y, SOUND_push, Xballoon); ply->x = x; ply->y = y; @@ -907,7 +907,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) case Xandroid_2_s: case Xandroid_1_w: case Xandroid_2_w: - switch(Cave[y+dy][x+dx]) + switch(Cave[x+dx][y+dy]) { case Xacid_1: case Xacid_2: @@ -917,25 +917,25 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) case Xacid_6: case Xacid_7: case Xacid_8: - if (Cave[y+dy-1][x+dx+1] == Xblank) - Cave[y+dy-1][x+dx+1] = Xacid_splash_e; - if (Cave[y+dy-1][x+dx-1] == Xblank) - Cave[y+dy-1][x+dx-1] = Xacid_splash_w; + if (Cave[x+dx+1][y+dy-1] == Xblank) + Cave[x+dx+1][y+dy-1] = Xacid_splash_e; + if (Cave[x+dx-1][y+dy-1] == Xblank) + Cave[x+dx-1][y+dy-1] = Xacid_splash_w; play_element_sound(x, y, SOUND_acid, Xacid_1); goto android_walk; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y+dy][x+dx] = (dy ? (dy < 0 ? Yandroid_n : Yandroid_s) : + Cave[x+dx][y+dy] = (dy ? (dy < 0 ? Yandroid_n : Yandroid_s) : (dx > 0 ? Yandroid_e : Yandroid_w)); - Next[y+dy][x+dx] = (dy ? (dy < 0 ? Xandroid_2_n : Xandroid_2_s) : + Next[x+dx][y+dy] = (dy ? (dy < 0 ? Xandroid_2_n : Xandroid_2_s) : (dx > 0 ? Xandroid_2_e : Xandroid_2_w)); android_walk: - Cave[y][x] = (dy ? (dy < 0 ? Yandroid_nB : Yandroid_sB) : + Cave[x][y] = (dy ? (dy < 0 ? Yandroid_nB : Yandroid_sB) : (dx > 0 ? Yandroid_eB : Yandroid_wB)); - Next[y][x] = Zplayer; + Next[x][y] = Zplayer; play_element_sound(x, y, SOUND_push, Xandroid); ply->x = x; ply->y = y; @@ -1001,11 +1001,11 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) break; door_walk: - if (!tab_blank[Cave[y+dy][x+dx]]) + if (!tab_blank[Cave[x+dx][y+dy]]) break; - Cave[y+dy][x+dx] = Zplayer; - Next[y+dy][x+dx] = Zplayer; + Cave[x+dx][y+dy] = Zplayer; + Next[x+dx][y+dy] = Zplayer; play_element_sound(x, y, SOUND_door, element); ply->anim = PLY_walk_n + anim; ply->x = x + dx; @@ -1056,8 +1056,8 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) break; case Xplant: - Cave[y][x] = Yplant; - Next[y][x] = Xplant; + Cave[x][y] = Yplant; + Next[x][y] = Xplant; play_element_sound(x, y, SOUND_blank, Xplant); ply->anim = PLY_walk_n + anim; ply->x = x; @@ -1084,30 +1084,30 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) } else /* player wants to snap */ { - int element = Cave[y][x]; + int element = Cave[x][y]; - switch(Cave[y][x]) + switch(Cave[x][y]) { /* fire is pressed */ case Xgrass: - Cave[y][x] = Ygrass_blank; - Next[y][x] = Xblank; + Cave[x][y] = Ygrass_blank; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_dirt, element); ply->anim = PLY_shoot_n + anim; break; case Xdirt: - Cave[y][x] = Ydirt_blank; - Next[y][x] = Xblank; + Cave[x][y] = Ydirt_blank; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_dirt, element); ply->anim = PLY_shoot_n + anim; break; case Xdiamond: case Xdiamond_pause: - Cave[y][x] = Ydiamond_blank; - Next[y][x] = Xblank; + Cave[x][y] = Ydiamond_blank; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_collect, element); lev.score += lev.diamond_score; lev.required = lev.required < 3 ? 0 : lev.required - 3; @@ -1117,8 +1117,8 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) case Xemerald: case Xemerald_pause: - Cave[y][x] = Yemerald_blank; - Next[y][x] = Xblank; + Cave[x][y] = Yemerald_blank; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_collect, element); lev.score += lev.emerald_score; lev.required = lev.required < 1 ? 0 : lev.required - 1; @@ -1127,8 +1127,8 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) break; case Xdynamite: - Cave[y][x] = Ydynamite_blank; - Next[y][x] = Xblank; + Cave[x][y] = Ydynamite_blank; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_collect, element); lev.score += lev.dynamite_score; ply->dynamite = ply->dynamite > 9998 ? 9999 : ply->dynamite + 1; @@ -1137,54 +1137,54 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) case Xkey_1: ply->keys |= 0x01; - Cave[y][x] = Ykey_1_blank; + Cave[x][y] = Ykey_1_blank; goto key_shoot; case Xkey_2: ply->keys |= 0x02; - Cave[y][x] = Ykey_2_blank; + Cave[x][y] = Ykey_2_blank; goto key_shoot; case Xkey_3: ply->keys |= 0x04; - Cave[y][x] = Ykey_3_blank; + Cave[x][y] = Ykey_3_blank; goto key_shoot; case Xkey_4: ply->keys |= 0x08; - Cave[y][x] = Ykey_4_blank; + Cave[x][y] = Ykey_4_blank; goto key_shoot; case Xkey_5: ply->keys |= 0x10; - Cave[y][x] = Ykey_5_blank; + Cave[x][y] = Ykey_5_blank; goto key_shoot; case Xkey_6: ply->keys |= 0x20; - Cave[y][x] = Ykey_6_blank; + Cave[x][y] = Ykey_6_blank; goto key_shoot; case Xkey_7: ply->keys |= 0x40; - Cave[y][x] = Ykey_7_blank; + Cave[x][y] = Ykey_7_blank; goto key_shoot; case Xkey_8: ply->keys |= 0x80; - Cave[y][x] = Ykey_8_blank; + Cave[x][y] = Ykey_8_blank; goto key_shoot; key_shoot: - Next[y][x] = Xblank; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_collect, element); lev.score += lev.key_score; ply->anim = PLY_walk_n + anim; break; case Xlenses: - Cave[y][x] = Ylenses_blank; - Next[y][x] = Xblank; + Cave[x][y] = Ylenses_blank; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_collect, element); lev.score += lev.lenses_score; lev.lenses_cnt = lev.lenses_time; @@ -1192,8 +1192,8 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) break; case Xmagnify: - Cave[y][x] = Ymagnify_blank; - Next[y][x] = Xblank; + Cave[x][y] = Ymagnify_blank; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_collect, element); lev.score += lev.magnify_score; lev.magnify_cnt = lev.magnify_time; diff --git a/src/game_em/synchro_2.c b/src/game_em/synchro_2.c index 68774735..a78266af 100644 --- a/src/game_em/synchro_2.c +++ b/src/game_em/synchro_2.c @@ -47,16 +47,16 @@ static void set_nearest_player_xy(int x, int y, int *dx, int *dy) static void Lboom_bug(int x, int y) { - Next[y][x] = Znormal; - Boom[y-1][x-1] = Xemerald; - Boom[y-1][x] = Xemerald; - Boom[y-1][x+1] = Xemerald; - Boom[y][x-1] = Xemerald; - Boom[y][x] = Xdiamond; - Boom[y][x+1] = Xemerald; - Boom[y+1][x-1] = Xemerald; - Boom[y+1][x] = Xemerald; - Boom[y+1][x+1] = Xemerald; + Next[x][y] = Znormal; + Boom[x-1][y-1] = Xemerald; + Boom[x][y-1] = Xemerald; + Boom[x+1][y-1] = Xemerald; + Boom[x-1][y] = Xemerald; + Boom[x][y] = Xdiamond; + Boom[x+1][y] = Xemerald; + Boom[x-1][y+1] = Xemerald; + Boom[x][y+1] = Xemerald; + Boom[x+1][y+1] = Xemerald; #if PLAY_ELEMENT_SOUND play_element_sound(x, y, SOUND_boom, element); @@ -65,16 +65,16 @@ static void Lboom_bug(int x, int y) static void Lboom_tank(int x, int y) { - Next[y][x] = Znormal; - Boom[y-1][x-1] = Xblank; - Boom[y-1][x] = Xblank; - Boom[y-1][x+1] = Xblank; - Boom[y][x-1] = Xblank; - Boom[y][x] = Xblank; - Boom[y][x+1] = Xblank; - Boom[y+1][x-1] = Xblank; - Boom[y+1][x] = Xblank; - Boom[y+1][x+1] = Xblank; + Next[x][y] = Znormal; + Boom[x-1][y-1] = Xblank; + Boom[x][y-1] = Xblank; + Boom[x+1][y-1] = Xblank; + Boom[x-1][y] = Xblank; + Boom[x][y] = Xblank; + Boom[x+1][y] = Xblank; + Boom[x-1][y+1] = Xblank; + Boom[x][y+1] = Xblank; + Boom[x+1][y+1] = Xblank; #if PLAY_ELEMENT_SOUND play_element_sound(x, y, SOUND_boom, element); #endif @@ -86,14 +86,14 @@ static void Landroid(int x, int y) if (lev.android_clone_cnt == 0) { - if (Cave[y-1][x-1] != Xblank && - Cave[y-1][x] != Xblank && - Cave[y-1][x+1] != Xblank && - Cave[y][x-1] != Xblank && - Cave[y][x+1] != Xblank && - Cave[y+1][x-1] != Xblank && - Cave[y+1][x] != Xblank && - Cave[y+1][x+1] != Xblank) + if (Cave[x-1][y-1] != Xblank && + Cave[x][y-1] != Xblank && + Cave[x+1][y-1] != Xblank && + Cave[x-1][y] != Xblank && + Cave[x+1][y] != Xblank && + Cave[x-1][y+1] != Xblank && + Cave[x][y+1] != Xblank && + Cave[x+1][y+1] != Xblank) goto android_move; switch (RANDOM(8)) @@ -101,95 +101,95 @@ static void Landroid(int x, int y) /* randomly find an object to clone */ case 0: /* S,NE,W,NW,SE,E,SW,N */ - temp = lev.android_array[Cave[y+1][x]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x][y-1]]; if (temp != Xblank) break; goto android_move; case 1: /* NW,SE,N,S,NE,SW,E,W */ - temp = lev.android_array[Cave[y-1][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y][x-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y]]; if (temp != Xblank) break; goto android_move; case 2: /* SW,E,S,W,N,NW,SE,NE */ - temp = lev.android_array[Cave[y+1][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y-1]]; if (temp != Xblank) break; goto android_move; case 3: /* N,SE,NE,E,W,S,NW,SW */ - temp = lev.android_array[Cave[y-1][x]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y+1]]; if (temp != Xblank) break; goto android_move; case 4: /* SE,NW,E,NE,SW,W,N,S */ - temp = lev.android_array[Cave[y+1][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x][y+1]]; if (temp != Xblank) break; goto android_move; case 5: /* NE,W,SE,SW,S,N,E,NW */ - temp = lev.android_array[Cave[y-1][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y-1]]; if (temp != Xblank) break; goto android_move; case 6: /* E,N,SW,S,NW,NE,SE,W */ - temp = lev.android_array[Cave[y][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y][x-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y]]; if (temp != Xblank) break; goto android_move; case 7: /* W,SW,NW,N,E,SE,NE,S */ - temp = lev.android_array[Cave[y][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x-1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y-1][x+1]]; if (temp != Xblank) break; - temp = lev.android_array[Cave[y+1][x]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x-1][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y+1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x+1][y-1]]; if (temp != Xblank) break; + temp = lev.android_array[Cave[x][y+1]]; if (temp != Xblank) break; goto android_move; } - Next[y][x] = temp; /* the item we chose to clone */ + Next[x][y] = temp; /* the item we chose to clone */ play_element_sound(x, y, SOUND_android_clone, temp); switch (RANDOM(8)) @@ -197,91 +197,91 @@ static void Landroid(int x, int y) /* randomly find a direction to move */ case 0: /* S,NE,W,NW,SE,E,SW,N */ - if (Cave[y+1][x] == Xblank) goto android_s; - if (Cave[y-1][x+1] == Xblank) goto android_ne; - if (Cave[y][x-1] == Xblank) goto android_w; - if (Cave[y-1][x-1] == Xblank) goto android_nw; - if (Cave[y+1][x+1] == Xblank) goto android_se; - if (Cave[y][x+1] == Xblank) goto android_e; - if (Cave[y+1][x-1] == Xblank) goto android_sw; - if (Cave[y-1][x] == Xblank) goto android_n; + if (Cave[x][y+1] == Xblank) goto android_s; + if (Cave[x+1][y-1] == Xblank) goto android_ne; + if (Cave[x-1][y] == Xblank) goto android_w; + if (Cave[x-1][y-1] == Xblank) goto android_nw; + if (Cave[x+1][y+1] == Xblank) goto android_se; + if (Cave[x+1][y] == Xblank) goto android_e; + if (Cave[x-1][y+1] == Xblank) goto android_sw; + if (Cave[x][y-1] == Xblank) goto android_n; goto android_move; case 1: /* NW,SE,N,S,NE,SW,E,W */ - if (Cave[y-1][x-1] == Xblank) goto android_nw; - if (Cave[y+1][x+1] == Xblank) goto android_se; - if (Cave[y-1][x] == Xblank) goto android_n; - if (Cave[y+1][x] == Xblank) goto android_s; - if (Cave[y-1][x+1] == Xblank) goto android_ne; - if (Cave[y+1][x-1] == Xblank) goto android_sw; - if (Cave[y][x+1] == Xblank) goto android_e; - if (Cave[y][x-1] == Xblank) goto android_w; + if (Cave[x-1][y-1] == Xblank) goto android_nw; + if (Cave[x+1][y+1] == Xblank) goto android_se; + if (Cave[x][y-1] == Xblank) goto android_n; + if (Cave[x][y+1] == Xblank) goto android_s; + if (Cave[x+1][y-1] == Xblank) goto android_ne; + if (Cave[x-1][y+1] == Xblank) goto android_sw; + if (Cave[x+1][y] == Xblank) goto android_e; + if (Cave[x-1][y] == Xblank) goto android_w; goto android_move; case 2: /* SW,E,S,W,N,NW,SE,NE */ - if (Cave[y+1][x-1] == Xblank) goto android_sw; - if (Cave[y][x+1] == Xblank) goto android_e; - if (Cave[y+1][x] == Xblank) goto android_s; - if (Cave[y][x-1] == Xblank) goto android_w; - if (Cave[y-1][x] == Xblank) goto android_n; - if (Cave[y-1][x-1] == Xblank) goto android_nw; - if (Cave[y+1][x+1] == Xblank) goto android_se; - if (Cave[y-1][x+1] == Xblank) goto android_ne; + if (Cave[x-1][y+1] == Xblank) goto android_sw; + if (Cave[x+1][y] == Xblank) goto android_e; + if (Cave[x][y+1] == Xblank) goto android_s; + if (Cave[x-1][y] == Xblank) goto android_w; + if (Cave[x][y-1] == Xblank) goto android_n; + if (Cave[x-1][y-1] == Xblank) goto android_nw; + if (Cave[x+1][y+1] == Xblank) goto android_se; + if (Cave[x+1][y-1] == Xblank) goto android_ne; goto android_move; case 3: /* N,SE,NE,E,W,S,NW,SW */ - if (Cave[y-1][x] == Xblank) goto android_n; - if (Cave[y+1][x+1] == Xblank) goto android_se; - if (Cave[y-1][x+1] == Xblank) goto android_ne; - if (Cave[y][x+1] == Xblank) goto android_e; - if (Cave[y][x-1] == Xblank) goto android_w; - if (Cave[y+1][x] == Xblank) goto android_s; - if (Cave[y-1][x-1] == Xblank) goto android_nw; - if (Cave[y+1][x-1] == Xblank) goto android_sw; + if (Cave[x][y-1] == Xblank) goto android_n; + if (Cave[x+1][y+1] == Xblank) goto android_se; + if (Cave[x+1][y-1] == Xblank) goto android_ne; + if (Cave[x+1][y] == Xblank) goto android_e; + if (Cave[x-1][y] == Xblank) goto android_w; + if (Cave[x][y+1] == Xblank) goto android_s; + if (Cave[x-1][y-1] == Xblank) goto android_nw; + if (Cave[x-1][y+1] == Xblank) goto android_sw; goto android_move; case 4: /* SE,NW,E,NE,SW,W,N,S */ - if (Cave[y+1][x+1] == Xblank) goto android_se; - if (Cave[y-1][x-1] == Xblank) goto android_nw; - if (Cave[y][x+1] == Xblank) goto android_e; - if (Cave[y-1][x+1] == Xblank) goto android_ne; - if (Cave[y+1][x-1] == Xblank) goto android_sw; - if (Cave[y][x-1] == Xblank) goto android_w; - if (Cave[y-1][x] == Xblank) goto android_n; - if (Cave[y+1][x] == Xblank) goto android_s; + if (Cave[x+1][y+1] == Xblank) goto android_se; + if (Cave[x-1][y-1] == Xblank) goto android_nw; + if (Cave[x+1][y] == Xblank) goto android_e; + if (Cave[x+1][y-1] == Xblank) goto android_ne; + if (Cave[x-1][y+1] == Xblank) goto android_sw; + if (Cave[x-1][y] == Xblank) goto android_w; + if (Cave[x][y-1] == Xblank) goto android_n; + if (Cave[x][y+1] == Xblank) goto android_s; goto android_move; case 5: /* NE,W,SE,SW,S,N,E,NW */ - if (Cave[y-1][x+1] == Xblank) goto android_ne; - if (Cave[y][x-1] == Xblank) goto android_w; - if (Cave[y+1][x+1] == Xblank) goto android_se; - if (Cave[y+1][x-1] == Xblank) goto android_sw; - if (Cave[y+1][x] == Xblank) goto android_s; - if (Cave[y-1][x] == Xblank) goto android_n; - if (Cave[y][x+1] == Xblank) goto android_e; - if (Cave[y-1][x-1] == Xblank) goto android_nw; + if (Cave[x+1][y-1] == Xblank) goto android_ne; + if (Cave[x-1][y] == Xblank) goto android_w; + if (Cave[x+1][y+1] == Xblank) goto android_se; + if (Cave[x-1][y+1] == Xblank) goto android_sw; + if (Cave[x][y+1] == Xblank) goto android_s; + if (Cave[x][y-1] == Xblank) goto android_n; + if (Cave[x+1][y] == Xblank) goto android_e; + if (Cave[x-1][y-1] == Xblank) goto android_nw; goto android_move; case 6: /* E,N,SW,S,NW,NE,SE,W */ - if (Cave[y][x+1] == Xblank) goto android_e; - if (Cave[y-1][x] == Xblank) goto android_n; - if (Cave[y+1][x-1] == Xblank) goto android_sw; - if (Cave[y+1][x] == Xblank) goto android_s; - if (Cave[y-1][x-1] == Xblank) goto android_nw; - if (Cave[y-1][x+1] == Xblank) goto android_ne; - if (Cave[y+1][x+1] == Xblank) goto android_se; - if (Cave[y][x-1] == Xblank) goto android_w; + if (Cave[x+1][y] == Xblank) goto android_e; + if (Cave[x][y-1] == Xblank) goto android_n; + if (Cave[x-1][y+1] == Xblank) goto android_sw; + if (Cave[x][y+1] == Xblank) goto android_s; + if (Cave[x-1][y-1] == Xblank) goto android_nw; + if (Cave[x+1][y-1] == Xblank) goto android_ne; + if (Cave[x+1][y+1] == Xblank) goto android_se; + if (Cave[x-1][y] == Xblank) goto android_w; goto android_move; case 7: /* W,SW,NW,N,E,SE,NE,S */ - if (Cave[y][x-1] == Xblank) goto android_w; - if (Cave[y+1][x-1] == Xblank) goto android_sw; - if (Cave[y-1][x-1] == Xblank) goto android_nw; - if (Cave[y-1][x] == Xblank) goto android_n; - if (Cave[y][x+1] == Xblank) goto android_e; - if (Cave[y+1][x+1] == Xblank) goto android_se; - if (Cave[y-1][x+1] == Xblank) goto android_ne; - if (Cave[y+1][x] == Xblank) goto android_s; + if (Cave[x-1][y] == Xblank) goto android_w; + if (Cave[x-1][y+1] == Xblank) goto android_sw; + if (Cave[x-1][y-1] == Xblank) goto android_nw; + if (Cave[x][y-1] == Xblank) goto android_n; + if (Cave[x+1][y] == Xblank) goto android_e; + if (Cave[x+1][y+1] == Xblank) goto android_se; + if (Cave[x+1][y-1] == Xblank) goto android_ne; + if (Cave[x][y+1] == Xblank) goto android_s; goto android_move; } } @@ -289,19 +289,19 @@ static void Landroid(int x, int y) android_move: if (lev.android_move_cnt == 0) { - if (Cave[y-1][x-1] == Zplayer || - Cave[y-1][x] == Zplayer || - Cave[y-1][x+1] == Zplayer || - Cave[y][x-1] == Zplayer || - Cave[y][x+1] == Zplayer || - Cave[y+1][x-1] == Zplayer || - Cave[y+1][x] == Zplayer || - Cave[y+1][x+1] == Zplayer) + if (Cave[x-1][y-1] == Zplayer || + Cave[x][y-1] == Zplayer || + Cave[x+1][y-1] == Zplayer || + Cave[x-1][y] == Zplayer || + Cave[x+1][y] == Zplayer || + Cave[x-1][y+1] == Zplayer || + Cave[x][y+1] == Zplayer || + Cave[x+1][y+1] == Zplayer) goto android_still; set_nearest_player_xy(x, y, &dx, &dy); - Next[y][x] = Xblank; /* assume we will move */ + Next[x][y] = Xblank; /* assume we will move */ temp = ((x < dx) + 1 - (x > dx)) + ((y < dy) + 1 - (y > dy)) * 3; if (RANDOM(2)) @@ -311,54 +311,54 @@ static void Landroid(int x, int y) /* attempt clockwise move first if direct path is blocked */ case 0: /* north west */ - if (tab_android_move[Cave[y-1][x-1]]) goto android_nw; - if (tab_android_move[Cave[y-1][x]]) goto android_n; - if (tab_android_move[Cave[y][x-1]]) goto android_w; + if (tab_android_move[Cave[x-1][y-1]]) goto android_nw; + if (tab_android_move[Cave[x][y-1]]) goto android_n; + if (tab_android_move[Cave[x-1][y]]) goto android_w; break; case 1: /* north */ - if (tab_android_move[Cave[y-1][x]]) goto android_n; - if (tab_android_move[Cave[y-1][x+1]]) goto android_ne; - if (tab_android_move[Cave[y-1][x-1]]) goto android_nw; + if (tab_android_move[Cave[x][y-1]]) goto android_n; + if (tab_android_move[Cave[x+1][y-1]]) goto android_ne; + if (tab_android_move[Cave[x-1][y-1]]) goto android_nw; break; case 2: /* north east */ - if (tab_android_move[Cave[y-1][x+1]]) goto android_ne; - if (tab_android_move[Cave[y][x+1]]) goto android_e; - if (tab_android_move[Cave[y-1][x]]) goto android_n; + if (tab_android_move[Cave[x+1][y-1]]) goto android_ne; + if (tab_android_move[Cave[x+1][y]]) goto android_e; + if (tab_android_move[Cave[x][y-1]]) goto android_n; break; case 3: /* west */ - if (tab_android_move[Cave[y][x-1]]) goto android_w; - if (tab_android_move[Cave[y-1][x-1]]) goto android_nw; - if (tab_android_move[Cave[y+1][x-1]]) goto android_sw; + if (tab_android_move[Cave[x-1][y]]) goto android_w; + if (tab_android_move[Cave[x-1][y-1]]) goto android_nw; + if (tab_android_move[Cave[x-1][y+1]]) goto android_sw; break; case 4: /* nowhere */ break; case 5: /* east */ - if (tab_android_move[Cave[y][x+1]]) goto android_e; - if (tab_android_move[Cave[y+1][x+1]]) goto android_se; - if (tab_android_move[Cave[y-1][x+1]]) goto android_ne; + if (tab_android_move[Cave[x+1][y]]) goto android_e; + if (tab_android_move[Cave[x+1][y+1]]) goto android_se; + if (tab_android_move[Cave[x+1][y-1]]) goto android_ne; break; case 6: /* south west */ - if (tab_android_move[Cave[y+1][x-1]]) goto android_sw; - if (tab_android_move[Cave[y][x-1]]) goto android_w; - if (tab_android_move[Cave[y+1][x]]) goto android_s; + if (tab_android_move[Cave[x-1][y+1]]) goto android_sw; + if (tab_android_move[Cave[x-1][y]]) goto android_w; + if (tab_android_move[Cave[x][y+1]]) goto android_s; break; case 7: /* south */ - if (tab_android_move[Cave[y+1][x]]) goto android_s; - if (tab_android_move[Cave[y+1][x-1]]) goto android_sw; - if (tab_android_move[Cave[y+1][x+1]]) goto android_se; + if (tab_android_move[Cave[x][y+1]]) goto android_s; + if (tab_android_move[Cave[x-1][y+1]]) goto android_sw; + if (tab_android_move[Cave[x+1][y+1]]) goto android_se; break; case 8: /* south east */ - if (tab_android_move[Cave[y+1][x+1]]) goto android_se; - if (tab_android_move[Cave[y+1][x]]) goto android_s; - if (tab_android_move[Cave[y][x+1]]) goto android_e; + if (tab_android_move[Cave[x+1][y+1]]) goto android_se; + if (tab_android_move[Cave[x][y+1]]) goto android_s; + if (tab_android_move[Cave[x+1][y]]) goto android_e; break; } } @@ -369,123 +369,123 @@ static void Landroid(int x, int y) /* attempt counterclockwise move first if direct path is blocked */ case 0: /* north west */ - if (tab_android_move[Cave[y-1][x-1]]) goto android_nw; - if (tab_android_move[Cave[y][x-1]]) goto android_w; - if (tab_android_move[Cave[y-1][x]]) goto android_n; + if (tab_android_move[Cave[x-1][y-1]]) goto android_nw; + if (tab_android_move[Cave[x-1][y]]) goto android_w; + if (tab_android_move[Cave[x][y-1]]) goto android_n; break; case 1: /* north */ - if (tab_android_move[Cave[y-1][x]]) goto android_n; - if (tab_android_move[Cave[y-1][x-1]]) goto android_nw; - if (tab_android_move[Cave[y-1][x+1]]) goto android_ne; + if (tab_android_move[Cave[x][y-1]]) goto android_n; + if (tab_android_move[Cave[x-1][y-1]]) goto android_nw; + if (tab_android_move[Cave[x+1][y-1]]) goto android_ne; break; case 2: /* north east */ - if (tab_android_move[Cave[y-1][x+1]]) goto android_ne; - if (tab_android_move[Cave[y-1][x]]) goto android_n; - if (tab_android_move[Cave[y][x+1]]) goto android_e; + if (tab_android_move[Cave[x+1][y-1]]) goto android_ne; + if (tab_android_move[Cave[x][y-1]]) goto android_n; + if (tab_android_move[Cave[x+1][y]]) goto android_e; break; case 3: /* west */ - if (tab_android_move[Cave[y][x-1]]) goto android_w; - if (tab_android_move[Cave[y+1][x-1]]) goto android_sw; - if (tab_android_move[Cave[y-1][x-1]]) goto android_nw; + if (tab_android_move[Cave[x-1][y]]) goto android_w; + if (tab_android_move[Cave[x-1][y+1]]) goto android_sw; + if (tab_android_move[Cave[x-1][y-1]]) goto android_nw; break; case 4: /* nowhere */ break; case 5: /* east */ - if (tab_android_move[Cave[y][x+1]]) goto android_e; - if (tab_android_move[Cave[y-1][x+1]]) goto android_ne; - if (tab_android_move[Cave[y+1][x+1]]) goto android_se; + if (tab_android_move[Cave[x+1][y]]) goto android_e; + if (tab_android_move[Cave[x+1][y-1]]) goto android_ne; + if (tab_android_move[Cave[x+1][y+1]]) goto android_se; break; case 6: /* south west */ - if (tab_android_move[Cave[y+1][x-1]]) goto android_sw; - if (tab_android_move[Cave[y+1][x]]) goto android_s; - if (tab_android_move[Cave[y][x-1]]) goto android_w; + if (tab_android_move[Cave[x-1][y+1]]) goto android_sw; + if (tab_android_move[Cave[x][y+1]]) goto android_s; + if (tab_android_move[Cave[x-1][y]]) goto android_w; break; case 7: /* south */ - if (tab_android_move[Cave[y+1][x]]) goto android_s; - if (tab_android_move[Cave[y+1][x+1]]) goto android_se; - if (tab_android_move[Cave[y+1][x-1]]) goto android_sw; + if (tab_android_move[Cave[x][y+1]]) goto android_s; + if (tab_android_move[Cave[x+1][y+1]]) goto android_se; + if (tab_android_move[Cave[x-1][y+1]]) goto android_sw; break; case 8: /* south east */ - if (tab_android_move[Cave[y+1][x+1]]) goto android_se; - if (tab_android_move[Cave[y][x+1]]) goto android_e; - if (tab_android_move[Cave[y+1][x]]) goto android_s; + if (tab_android_move[Cave[x+1][y+1]]) goto android_se; + if (tab_android_move[Cave[x+1][y]]) goto android_e; + if (tab_android_move[Cave[x][y+1]]) goto android_s; break; } } } android_still: - Next[y][x] = Xandroid; + Next[x][y] = Xandroid; return; android_n: - Cave[y][x] = Yandroid_nB; - Cave[y-1][x] = Yandroid_n; - Next[y-1][x] = Xandroid; + Cave[x][y] = Yandroid_nB; + Cave[x][y-1] = Yandroid_n; + Next[x][y-1] = Xandroid; play_element_sound(x, y, SOUND_android_move, Xandroid); return; android_ne: - Cave[y][x] = Yandroid_neB; - Cave[y-1][x+1] = Yandroid_ne; - Next[y-1][x+1] = Xandroid; + Cave[x][y] = Yandroid_neB; + Cave[x+1][y-1] = Yandroid_ne; + Next[x+1][y-1] = Xandroid; play_element_sound(x, y, SOUND_android_move, Xandroid); return; android_e: - Cave[y][x] = Yandroid_eB; - Cave[y][x+1] = Yandroid_e; - Next[y][x+1] = Xandroid; + Cave[x][y] = Yandroid_eB; + Cave[x+1][y] = Yandroid_e; + Next[x+1][y] = Xandroid; play_element_sound(x, y, SOUND_android_move, Xandroid); return; android_se: - Cave[y][x] = Yandroid_seB; - Cave[y+1][x+1] = Yandroid_se; - Next[y+1][x+1] = Xandroid; + Cave[x][y] = Yandroid_seB; + Cave[x+1][y+1] = Yandroid_se; + Next[x+1][y+1] = Xandroid; play_element_sound(x, y, SOUND_android_move, Xandroid); return; android_s: - Cave[y][x] = Yandroid_sB; - Cave[y+1][x] = Yandroid_s; - Next[y+1][x] = Xandroid; + Cave[x][y] = Yandroid_sB; + Cave[x][y+1] = Yandroid_s; + Next[x][y+1] = Xandroid; play_element_sound(x, y, SOUND_android_move, Xandroid); return; android_sw: - Cave[y][x] = Yandroid_swB; - Cave[y+1][x-1] = Yandroid_sw; - Next[y+1][x-1] = Xandroid; + Cave[x][y] = Yandroid_swB; + Cave[x-1][y+1] = Yandroid_sw; + Next[x-1][y+1] = Xandroid; play_element_sound(x, y, SOUND_android_move, Xandroid); return; android_w: - Cave[y][x] = Yandroid_wB; - Cave[y][x-1] = Yandroid_w; - Next[y][x-1] = Xandroid; + Cave[x][y] = Yandroid_wB; + Cave[x-1][y] = Yandroid_w; + Next[x-1][y] = Xandroid; play_element_sound(x, y, SOUND_android_move, Xandroid); return; android_nw: - Cave[y][x] = Yandroid_nwB; - Cave[y-1][x-1] = Yandroid_nw; - Next[y-1][x-1] = Xandroid; + Cave[x][y] = Yandroid_nwB; + Cave[x-1][y-1] = Yandroid_nw; + Next[x-1][y-1] = Xandroid; play_element_sound(x, y, SOUND_android_move, Xandroid); return; } static void Landroid_1_n(int x, int y) { - switch (Cave[y-1][x]) + switch (Cave[x][y-1]) { case Xacid_1: case Xacid_2: @@ -495,22 +495,22 @@ static void Landroid_1_n(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yandroid_nB; - if (Cave[y-2][x+1] == Xblank) - Cave[y-2][x+1] = Xacid_splash_e; - if (Cave[y-2][x-1] == Xblank) - Cave[y-2][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yandroid_nB; + if (Cave[x+1][y-2] == Xblank) + Cave[x+1][y-2] = Xacid_splash_e; + if (Cave[x-1][y-2] == Xblank) + Cave[x-1][y-2] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Yandroid_nB; - Cave[y-1][x] = Yandroid_n; - Next[y][x] = Xblank; - Next[y-1][x] = Xandroid; + Cave[x][y] = Yandroid_nB; + Cave[x][y-1] = Yandroid_n; + Next[x][y] = Xblank; + Next[x][y-1] = Xandroid; play_element_sound(x, y, SOUND_android_move, Xandroid_1_n); return; @@ -522,7 +522,7 @@ static void Landroid_1_n(int x, int y) static void Landroid_2_n(int x, int y) { - switch (Cave[y-1][x]) + switch (Cave[x][y-1]) { case Xacid_1: case Xacid_2: @@ -532,22 +532,22 @@ static void Landroid_2_n(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yandroid_nB; - if (Cave[y-2][x+1] == Xblank) - Cave[y-2][x+1] = Xacid_splash_e; - if (Cave[y-2][x-1] == Xblank) - Cave[y-2][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yandroid_nB; + if (Cave[x+1][y-2] == Xblank) + Cave[x+1][y-2] = Xacid_splash_e; + if (Cave[x-1][y-2] == Xblank) + Cave[x-1][y-2] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Yandroid_nB; - Cave[y-1][x] = Yandroid_n; - Next[y][x] = Xblank; - Next[y-1][x] = Xandroid_1_n; + Cave[x][y] = Yandroid_nB; + Cave[x][y-1] = Yandroid_n; + Next[x][y] = Xblank; + Next[x][y-1] = Xandroid_1_n; play_element_sound(x, y, SOUND_android_move, Xandroid_2_n); return; @@ -559,7 +559,7 @@ static void Landroid_2_n(int x, int y) static void Landroid_1_e(int x, int y) { - switch (Cave[y][x+1]) + switch (Cave[x+1][y]) { case Xacid_1: case Xacid_2: @@ -569,22 +569,22 @@ static void Landroid_1_e(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yandroid_eB; - if (Cave[y-1][x+2] == Xblank) - Cave[y-1][x+2] = Xacid_splash_e; - if (Cave[y-1][x] == Xblank) - Cave[y-1][x] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yandroid_eB; + if (Cave[x+2][y-1] == Xblank) + Cave[x+2][y-1] = Xacid_splash_e; + if (Cave[x][y-1] == Xblank) + Cave[x][y-1] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Yandroid_eB; - Cave[y][x+1] = Yandroid_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xandroid; + Cave[x][y] = Yandroid_eB; + Cave[x+1][y] = Yandroid_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xandroid; play_element_sound(x, y, SOUND_android_move, Xandroid_1_e); return; @@ -596,7 +596,7 @@ static void Landroid_1_e(int x, int y) static void Landroid_2_e(int x, int y) { - switch (Cave[y][x+1]) + switch (Cave[x+1][y]) { case Xacid_1: case Xacid_2: @@ -606,22 +606,22 @@ static void Landroid_2_e(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yandroid_eB; - if (Cave[y-1][x+2] == Xblank) - Cave[y-1][x+2] = Xacid_splash_e; - if (Cave[y-1][x] == Xblank) - Cave[y-1][x] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yandroid_eB; + if (Cave[x+2][y-1] == Xblank) + Cave[x+2][y-1] = Xacid_splash_e; + if (Cave[x][y-1] == Xblank) + Cave[x][y-1] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Yandroid_eB; - Cave[y][x+1] = Yandroid_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xandroid_1_e; + Cave[x][y] = Yandroid_eB; + Cave[x+1][y] = Yandroid_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xandroid_1_e; play_element_sound(x, y, SOUND_android_move, Xandroid_2_e); return; @@ -633,7 +633,7 @@ static void Landroid_2_e(int x, int y) static void Landroid_1_s(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -643,22 +643,22 @@ static void Landroid_1_s(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yandroid_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yandroid_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Yandroid_sB; - Cave[y+1][x] = Yandroid_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xandroid; + Cave[x][y] = Yandroid_sB; + Cave[x][y+1] = Yandroid_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xandroid; play_element_sound(x, y, SOUND_android_move, Xandroid_1_s); return; @@ -670,7 +670,7 @@ static void Landroid_1_s(int x, int y) static void Landroid_2_s(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -680,22 +680,22 @@ static void Landroid_2_s(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yandroid_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yandroid_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Yandroid_sB; - Cave[y+1][x] = Yandroid_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xandroid_1_s; + Cave[x][y] = Yandroid_sB; + Cave[x][y+1] = Yandroid_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xandroid_1_s; play_element_sound(x, y, SOUND_android_move, Xandroid_2_s); return; @@ -707,7 +707,7 @@ static void Landroid_2_s(int x, int y) static void Landroid_1_w(int x, int y) { - switch (Cave[y][x-1]) + switch (Cave[x-1][y]) { case Xacid_1: case Xacid_2: @@ -717,22 +717,22 @@ static void Landroid_1_w(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yandroid_wB; - if (Cave[y-1][x] == Xblank) - Cave[y-1][x] = Xacid_splash_e; - if (Cave[y-1][x-2] == Xblank) - Cave[y-1][x-2] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yandroid_wB; + if (Cave[x][y-1] == Xblank) + Cave[x][y-1] = Xacid_splash_e; + if (Cave[x-2][y-1] == Xblank) + Cave[x-2][y-1] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Yandroid_wB; - Cave[y][x-1] = Yandroid_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xandroid; + Cave[x][y] = Yandroid_wB; + Cave[x-1][y] = Yandroid_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xandroid; play_element_sound(x, y, SOUND_android_move, Xandroid_1_w); return; @@ -744,7 +744,7 @@ static void Landroid_1_w(int x, int y) static void Landroid_2_w(int x, int y) { - switch (Cave[y][x-1]) + switch (Cave[x-1][y]) { case Xacid_1: case Xacid_2: @@ -754,22 +754,22 @@ static void Landroid_2_w(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yandroid_wB; - if (Cave[y-1][x] == Xblank) - Cave[y-1][x] = Xacid_splash_e; - if (Cave[y-1][x-2] == Xblank) - Cave[y-1][x-2] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yandroid_wB; + if (Cave[x][y-1] == Xblank) + Cave[x][y-1] = Xacid_splash_e; + if (Cave[x-2][y-1] == Xblank) + Cave[x-2][y-1] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Yandroid_wB; - Cave[y][x-1] = Yandroid_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xandroid_1_w; + Cave[x][y] = Yandroid_wB; + Cave[x-1][y] = Yandroid_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xandroid_1_w; play_element_sound(x, y, SOUND_android_move, Xandroid_1_w); return; @@ -781,39 +781,39 @@ static void Landroid_2_w(int x, int y) static void Leater_n(int x, int y) { - if (Cave[y][x+1] == Xdiamond) + if (Cave[x+1][y] == Xdiamond) { - Cave[y][x+1] = Ydiamond_blank; - Next[y][x+1] = Xblank; + Cave[x+1][y] = Ydiamond_blank; + Next[x+1][y] = Xblank; play_element_sound(x, y, SOUND_eater_eat, Xeater_n); return; } - if (Cave[y+1][x] == Xdiamond) + if (Cave[x][y+1] == Xdiamond) { - Cave[y+1][x] = Ydiamond_blank; - Next[y+1][x] = Xblank; + Cave[x][y+1] = Ydiamond_blank; + Next[x][y+1] = Xblank; play_element_sound(x, y, SOUND_eater_eat, Xeater_n); return; } - if (Cave[y][x-1] == Xdiamond) + if (Cave[x-1][y] == Xdiamond) { - Cave[y][x-1] = Ydiamond_blank; - Next[y][x-1] = Xblank; + Cave[x-1][y] = Ydiamond_blank; + Next[x-1][y] = Xblank; play_element_sound(x, y, SOUND_eater_eat, Xeater_n); return; } - if (Cave[y-1][x] == Xdiamond) + if (Cave[x][y-1] == Xdiamond) { - Cave[y-1][x] = Ydiamond_blank; - Next[y-1][x] = Xblank; + Cave[x][y-1] = Ydiamond_blank; + Next[x][y-1] = Xblank; play_element_sound(x, y, SOUND_eater_eat, Xeater_n); return; } - switch (Cave[y-1][x]) + switch (Cave[x][y-1]) { case Xacid_1: case Xacid_2: @@ -823,12 +823,12 @@ static void Leater_n(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yeater_nB; - if (Cave[y-2][x+1] == Xblank) - Cave[y-2][x+1] = Xacid_splash_e; - if (Cave[y-2][x-1] == Xblank) - Cave[y-2][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yeater_nB; + if (Cave[x+1][y-2] == Xblank) + Cave[x+1][y-2] = Xacid_splash_e; + if (Cave[x-1][y-2] == Xblank) + Cave[x-1][y-2] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -838,14 +838,14 @@ static void Leater_n(int x, int y) case Xplant: case Yplant: case Zplayer: - Cave[y][x] = Yeater_nB; - Cave[y-1][x] = Yeater_n; - Next[y][x] = Xblank; - Next[y-1][x] = Xeater_n; + Cave[x][y] = Yeater_nB; + Cave[x][y-1] = Yeater_n; + Next[x][y] = Xblank; + Next[x][y-1] = Xeater_n; return; default: - Next[y][x] = RANDOM(2) ? Xeater_e : Xeater_w; + Next[x][y] = RANDOM(2) ? Xeater_e : Xeater_w; play_element_sound(x, y, SOUND_eater, Xeater_n); return; } @@ -853,39 +853,39 @@ static void Leater_n(int x, int y) static void Leater_e(int x, int y) { - if (Cave[y+1][x] == Xdiamond) + if (Cave[x][y+1] == Xdiamond) { - Cave[y+1][x] = Ydiamond_blank; - Next[y+1][x] = Xblank; + Cave[x][y+1] = Ydiamond_blank; + Next[x][y+1] = Xblank; play_element_sound(x, y, SOUND_eater_eat, Xeater_e); return; } - if (Cave[y][x-1] == Xdiamond) + if (Cave[x-1][y] == Xdiamond) { - Cave[y][x-1] = Ydiamond_blank; - Next[y][x-1] = Xblank; + Cave[x-1][y] = Ydiamond_blank; + Next[x-1][y] = Xblank; play_element_sound(x, y, SOUND_eater_eat, Xeater_e); return; } - if (Cave[y-1][x] == Xdiamond) + if (Cave[x][y-1] == Xdiamond) { - Cave[y-1][x] = Ydiamond_blank; - Next[y-1][x] = Xblank; + Cave[x][y-1] = Ydiamond_blank; + Next[x][y-1] = Xblank; play_element_sound(x, y, SOUND_eater_eat, Xeater_e); return; } - if (Cave[y][x+1] == Xdiamond) + if (Cave[x+1][y] == Xdiamond) { - Cave[y][x+1] = Ydiamond_blank; - Next[y][x+1] = Xblank; + Cave[x+1][y] = Ydiamond_blank; + Next[x+1][y] = Xblank; play_element_sound(x, y, SOUND_eater_eat, Xeater_e); return; } - switch (Cave[y][x+1]) + switch (Cave[x+1][y]) { case Xacid_1: case Xacid_2: @@ -895,12 +895,12 @@ static void Leater_e(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yeater_eB; - if (Cave[y-1][x+2] == Xblank) - Cave[y-1][x+2] = Xacid_splash_e; - if (Cave[y-1][x] == Xblank) - Cave[y-1][x] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yeater_eB; + if (Cave[x+2][y-1] == Xblank) + Cave[x+2][y-1] = Xacid_splash_e; + if (Cave[x][y-1] == Xblank) + Cave[x][y-1] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -910,14 +910,14 @@ static void Leater_e(int x, int y) case Xplant: case Yplant: case Zplayer: - Cave[y][x] = Yeater_eB; - Cave[y][x+1] = Yeater_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xeater_e; + Cave[x][y] = Yeater_eB; + Cave[x+1][y] = Yeater_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xeater_e; return; default: - Next[y][x] = RANDOM(2) ? Xeater_n : Xeater_s; + Next[x][y] = RANDOM(2) ? Xeater_n : Xeater_s; play_element_sound(x, y, SOUND_eater, Xeater_e); return; } @@ -925,39 +925,39 @@ static void Leater_e(int x, int y) static void Leater_s(int x, int y) { - if (Cave[y][x-1] == Xdiamond) + if (Cave[x-1][y] == Xdiamond) { - Cave[y][x-1] = Ydiamond_blank; - Next[y][x-1] = Xblank; + Cave[x-1][y] = Ydiamond_blank; + Next[x-1][y] = Xblank; play_element_sound(x, y, SOUND_eater_eat, Xeater_s); return; } - if (Cave[y-1][x] == Xdiamond) + if (Cave[x][y-1] == Xdiamond) { - Cave[y-1][x] = Ydiamond_blank; - Next[y-1][x] = Xblank; + Cave[x][y-1] = Ydiamond_blank; + Next[x][y-1] = Xblank; play_element_sound(x, y, SOUND_eater_eat, Xeater_s); return; } - if (Cave[y][x+1] == Xdiamond) + if (Cave[x+1][y] == Xdiamond) { - Cave[y][x+1] = Ydiamond_blank; - Next[y][x+1] = Xblank; + Cave[x+1][y] = Ydiamond_blank; + Next[x+1][y] = Xblank; play_element_sound(x, y, SOUND_eater_eat, Xeater_s); return; } - if (Cave[y+1][x] == Xdiamond) + if (Cave[x][y+1] == Xdiamond) { - Cave[y+1][x] = Ydiamond_blank; - Next[y+1][x] = Xblank; + Cave[x][y+1] = Ydiamond_blank; + Next[x][y+1] = Xblank; play_element_sound(x, y, SOUND_eater_eat, Xeater_s); return; } - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -967,12 +967,12 @@ static void Leater_s(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yeater_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yeater_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -982,14 +982,14 @@ static void Leater_s(int x, int y) case Xplant: case Yplant: case Zplayer: - Cave[y][x] = Yeater_sB; - Cave[y+1][x] = Yeater_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xeater_s; + Cave[x][y] = Yeater_sB; + Cave[x][y+1] = Yeater_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xeater_s; return; default: - Next[y][x] = RANDOM(2) ? Xeater_e : Xeater_w; + Next[x][y] = RANDOM(2) ? Xeater_e : Xeater_w; play_element_sound(x, y, SOUND_eater, Xeater_s); return; } @@ -997,39 +997,39 @@ static void Leater_s(int x, int y) static void Leater_w(int x, int y) { - if (Cave[y-1][x] == Xdiamond) + if (Cave[x][y-1] == Xdiamond) { - Cave[y-1][x] = Ydiamond_blank; - Next[y-1][x] = Xblank; + Cave[x][y-1] = Ydiamond_blank; + Next[x][y-1] = Xblank; play_element_sound(x, y, SOUND_eater_eat, Xeater_w); return; } - if (Cave[y][x+1] == Xdiamond) + if (Cave[x+1][y] == Xdiamond) { - Cave[y][x+1] = Ydiamond_blank; - Next[y][x+1] = Xblank; + Cave[x+1][y] = Ydiamond_blank; + Next[x+1][y] = Xblank; play_element_sound(x, y, SOUND_eater_eat, Xeater_w); return; } - if (Cave[y+1][x] == Xdiamond) + if (Cave[x][y+1] == Xdiamond) { - Cave[y+1][x] = Ydiamond_blank; - Next[y+1][x] = Xblank; + Cave[x][y+1] = Ydiamond_blank; + Next[x][y+1] = Xblank; play_element_sound(x, y, SOUND_eater_eat, Xeater_w); return; } - if (Cave[y][x-1] == Xdiamond) + if (Cave[x-1][y] == Xdiamond) { - Cave[y][x-1] = Ydiamond_blank; - Next[y][x-1] = Xblank; + Cave[x-1][y] = Ydiamond_blank; + Next[x-1][y] = Xblank; play_element_sound(x, y, SOUND_eater_eat, Xeater_w); return; } - switch (Cave[y][x-1]) + switch (Cave[x-1][y]) { case Xacid_1: case Xacid_2: @@ -1039,12 +1039,12 @@ static void Leater_w(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yeater_wB; - if (Cave[y-1][x] == Xblank) - Cave[y-1][x] = Xacid_splash_e; - if (Cave[y-1][x-2] == Xblank) - Cave[y-1][x-2] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yeater_wB; + if (Cave[x][y-1] == Xblank) + Cave[x][y-1] = Xacid_splash_e; + if (Cave[x-2][y-1] == Xblank) + Cave[x-2][y-1] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -1054,14 +1054,14 @@ static void Leater_w(int x, int y) case Xplant: case Yplant: case Zplayer: - Cave[y][x] = Yeater_wB; - Cave[y][x-1] = Yeater_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xeater_w; + Cave[x][y] = Yeater_wB; + Cave[x-1][y] = Yeater_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xeater_w; return; default: - Next[y][x] = RANDOM(2) ? Xeater_n : Xeater_s; + Next[x][y] = RANDOM(2) ? Xeater_n : Xeater_s; play_element_sound(x, y, SOUND_eater, Xeater_w); return; } @@ -1085,7 +1085,7 @@ static void Lalien(int x, int y) { if (y > dy) { - switch (Cave[y-1][x]) + switch (Cave[x][y-1]) { case Xacid_1: case Xacid_2: @@ -1095,12 +1095,12 @@ static void Lalien(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yalien_nB; - if (Cave[y-2][x+1] == Xblank) - Cave[y-2][x+1] = Xacid_splash_e; - if (Cave[y-2][x-1] == Xblank) - Cave[y-2][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yalien_nB; + if (Cave[x+1][y-2] == Xblank) + Cave[x+1][y-2] = Xacid_splash_e; + if (Cave[x-1][y-2] == Xblank) + Cave[x-1][y-2] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -1110,17 +1110,17 @@ static void Lalien(int x, int y) case Xplant: case Yplant: case Zplayer: - Cave[y][x] = Yalien_nB; - Cave[y-1][x] = Yalien_n; - Next[y][x] = Xblank; - Next[y-1][x] = Xalien_pause; + Cave[x][y] = Yalien_nB; + Cave[x][y-1] = Yalien_n; + Next[x][y] = Xblank; + Next[x][y-1] = Xalien_pause; play_element_sound(x, y, SOUND_alien, Xalien); return; } } else if (y < dy) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -1130,12 +1130,12 @@ static void Lalien(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yalien_sB; - Next[y][x] = Xblank; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; + Cave[x][y] = Yalien_sB; + Next[x][y] = Xblank; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -1145,10 +1145,10 @@ static void Lalien(int x, int y) case Xplant: case Yplant: case Zplayer: - Cave[y][x] = Yalien_sB; - Cave[y+1][x] = Yalien_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xalien_pause; + Cave[x][y] = Yalien_sB; + Cave[x][y+1] = Yalien_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xalien_pause; play_element_sound(x, y, SOUND_alien, Xalien); return; } @@ -1158,7 +1158,7 @@ static void Lalien(int x, int y) { if (x < dx) { - switch (Cave[y][x+1]) + switch (Cave[x+1][y]) { case Xacid_1: case Xacid_2: @@ -1168,12 +1168,12 @@ static void Lalien(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yalien_eB; - if (Cave[y-1][x+2] == Xblank) - Cave[y-1][x+2] = Xacid_splash_e; - if (Cave[y-1][x] == Xblank) - Cave[y-1][x] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yalien_eB; + if (Cave[x+2][y-1] == Xblank) + Cave[x+2][y-1] = Xacid_splash_e; + if (Cave[x][y-1] == Xblank) + Cave[x][y-1] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -1183,17 +1183,17 @@ static void Lalien(int x, int y) case Xplant: case Yplant: case Zplayer: - Cave[y][x] = Yalien_eB; - Cave[y][x+1] = Yalien_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xalien_pause; + Cave[x][y] = Yalien_eB; + Cave[x+1][y] = Yalien_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xalien_pause; play_element_sound(x, y, SOUND_alien, Xalien); return; } } else if (x > dx) { - switch (Cave[y][x-1]) + switch (Cave[x-1][y]) { case Xacid_1: case Xacid_2: @@ -1203,12 +1203,12 @@ static void Lalien(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yalien_wB; - if (Cave[y-1][x] == Xblank) - Cave[y-1][x] = Xacid_splash_e; - if (Cave[y-1][x-2] == Xblank) - Cave[y-1][x-2] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yalien_wB; + if (Cave[x][y-1] == Xblank) + Cave[x][y-1] = Xacid_splash_e; + if (Cave[x-2][y-1] == Xblank) + Cave[x-2][y-1] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -1218,10 +1218,10 @@ static void Lalien(int x, int y) case Xplant: case Yplant: case Zplayer: - Cave[y][x] = Yalien_wB; - Cave[y][x-1] = Yalien_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xalien_pause; + Cave[x][y] = Yalien_wB; + Cave[x-1][y] = Yalien_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xalien_pause; play_element_sound(x, y, SOUND_alien, Xalien); return; } @@ -1231,12 +1231,12 @@ static void Lalien(int x, int y) static void Lalien_pause(int x, int y) { - Next[y][x] = Xalien; + Next[x][y] = Xalien; } static void Lbug_n(int x, int y) { - switch (Cave[y-1][x]) + switch (Cave[x][y-1]) { case Xacid_1: case Xacid_2: @@ -1246,12 +1246,12 @@ static void Lbug_n(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ybug_nB; - if (Cave[y-2][x+1] == Xblank) - Cave[y-2][x+1] = Xacid_splash_e; - if (Cave[y-2][x-1] == Xblank) - Cave[y-2][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ybug_nB; + if (Cave[x+1][y-2] == Xblank) + Cave[x+1][y-2] = Xacid_splash_e; + if (Cave[x-1][y-2] == Xblank) + Cave[x-1][y-2] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -1261,16 +1261,16 @@ static void Lbug_n(int x, int y) case Xplant: case Yplant: case Zplayer: - Cave[y][x] = Ybug_nB; - Cave[y-1][x] = Ybug_n; - Next[y][x] = Xblank; - Next[y-1][x] = Xbug_1_n; + Cave[x][y] = Ybug_nB; + Cave[x][y-1] = Ybug_n; + Next[x][y] = Xblank; + Next[x][y-1] = Xbug_1_n; play_element_sound(x, y, SOUND_bug, Xbug_1_n); return; default: - Cave[y][x] = Ybug_n_w; - Next[y][x] = Xbug_2_w; + Cave[x][y] = Ybug_n_w; + Next[x][y] = Xbug_2_w; play_element_sound(x, y, SOUND_bug, Xbug_1_n); return; } @@ -1278,17 +1278,17 @@ static void Lbug_n(int x, int y) static void Lbug_1_n(int x, int y) { - if (tab_amoeba[Cave[y-1][x]] || - tab_amoeba[Cave[y][x+1]] || - tab_amoeba[Cave[y+1][x]] || - tab_amoeba[Cave[y][x-1]]) + if (tab_amoeba[Cave[x][y-1]] || + tab_amoeba[Cave[x+1][y]] || + tab_amoeba[Cave[x][y+1]] || + tab_amoeba[Cave[x-1][y]]) { Lboom_bug(x, y); return; } - switch (Cave[y][x+1]) + switch (Cave[x+1][y]) { case Xblank: case Xacid_splash_e: @@ -1304,8 +1304,8 @@ static void Lbug_1_n(int x, int y) case Xacid_7: case Xacid_8: case Zplayer: - Cave[y][x] = Ybug_n_e; - Next[y][x] = Xbug_2_e; + Cave[x][y] = Ybug_n_e; + Next[x][y] = Xbug_2_e; play_element_sound(x, y, SOUND_bug, Xbug_1_n); return; @@ -1317,10 +1317,10 @@ static void Lbug_1_n(int x, int y) static void Lbug_2_n(int x, int y) { - if (tab_amoeba[Cave[y-1][x]] || - tab_amoeba[Cave[y][x+1]] || - tab_amoeba[Cave[y+1][x]] || - tab_amoeba[Cave[y][x-1]]) + if (tab_amoeba[Cave[x][y-1]] || + tab_amoeba[Cave[x+1][y]] || + tab_amoeba[Cave[x][y+1]] || + tab_amoeba[Cave[x-1][y]]) { Lboom_bug(x, y); @@ -1332,7 +1332,7 @@ static void Lbug_2_n(int x, int y) static void Lbug_e(int x, int y) { - switch (Cave[y][x+1]) + switch (Cave[x+1][y]) { case Xacid_1: case Xacid_2: @@ -1342,12 +1342,12 @@ static void Lbug_e(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ybug_eB; - if (Cave[y-1][x+2] == Xblank) - Cave[y-1][x+2] = Xacid_splash_e; - if (Cave[y-1][x] == Xblank) - Cave[y-1][x] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ybug_eB; + if (Cave[x+2][y-1] == Xblank) + Cave[x+2][y-1] = Xacid_splash_e; + if (Cave[x][y-1] == Xblank) + Cave[x][y-1] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -1357,16 +1357,16 @@ static void Lbug_e(int x, int y) case Xplant: case Yplant: case Zplayer: - Cave[y][x] = Ybug_eB; - Cave[y][x+1] = Ybug_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xbug_1_e; + Cave[x][y] = Ybug_eB; + Cave[x+1][y] = Ybug_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xbug_1_e; play_element_sound(x, y, SOUND_bug, Xbug_1_e); return; default: - Cave[y][x] = Ybug_e_n; - Next[y][x] = Xbug_2_n; + Cave[x][y] = Ybug_e_n; + Next[x][y] = Xbug_2_n; play_element_sound(x, y, SOUND_bug, Xbug_1_e); return; } @@ -1374,17 +1374,17 @@ static void Lbug_e(int x, int y) static void Lbug_1_e(int x, int y) { - if (tab_amoeba[Cave[y-1][x]] || - tab_amoeba[Cave[y][x+1]] || - tab_amoeba[Cave[y+1][x]] || - tab_amoeba[Cave[y][x-1]]) + if (tab_amoeba[Cave[x][y-1]] || + tab_amoeba[Cave[x+1][y]] || + tab_amoeba[Cave[x][y+1]] || + tab_amoeba[Cave[x-1][y]]) { Lboom_bug(x, y); return; } - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xblank: case Xacid_splash_e: @@ -1400,8 +1400,8 @@ static void Lbug_1_e(int x, int y) case Xacid_7: case Xacid_8: case Zplayer: - Cave[y][x] = Ybug_e_s; - Next[y][x] = Xbug_2_s; + Cave[x][y] = Ybug_e_s; + Next[x][y] = Xbug_2_s; play_element_sound(x, y, SOUND_bug, Xbug_1_e); return; @@ -1413,10 +1413,10 @@ static void Lbug_1_e(int x, int y) static void Lbug_2_e(int x, int y) { - if (tab_amoeba[Cave[y-1][x]] || - tab_amoeba[Cave[y][x+1]] || - tab_amoeba[Cave[y+1][x]] || - tab_amoeba[Cave[y][x-1]]) + if (tab_amoeba[Cave[x][y-1]] || + tab_amoeba[Cave[x+1][y]] || + tab_amoeba[Cave[x][y+1]] || + tab_amoeba[Cave[x-1][y]]) { Lboom_bug(x, y); @@ -1428,7 +1428,7 @@ static void Lbug_2_e(int x, int y) static void Lbug_s(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -1438,12 +1438,12 @@ static void Lbug_s(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ybug_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ybug_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -1453,16 +1453,16 @@ static void Lbug_s(int x, int y) case Xplant: case Yplant: case Zplayer: - Cave[y][x] = Ybug_sB; - Cave[y+1][x] = Ybug_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xbug_1_s; + Cave[x][y] = Ybug_sB; + Cave[x][y+1] = Ybug_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xbug_1_s; play_element_sound(x, y, SOUND_bug, Xbug_1_s); return; default: - Cave[y][x] = Ybug_s_e; - Next[y][x] = Xbug_2_e; + Cave[x][y] = Ybug_s_e; + Next[x][y] = Xbug_2_e; play_element_sound(x, y, SOUND_bug, Xbug_1_s); return; } @@ -1470,17 +1470,17 @@ static void Lbug_s(int x, int y) static void Lbug_1_s(int x, int y) { - if (tab_amoeba[Cave[y-1][x]] || - tab_amoeba[Cave[y][x+1]] || - tab_amoeba[Cave[y+1][x]] || - tab_amoeba[Cave[y][x-1]]) + if (tab_amoeba[Cave[x][y-1]] || + tab_amoeba[Cave[x+1][y]] || + tab_amoeba[Cave[x][y+1]] || + tab_amoeba[Cave[x-1][y]]) { Lboom_bug(x, y); return; } - switch (Cave[y][x-1]) + switch (Cave[x-1][y]) { case Xblank: case Xacid_splash_e: @@ -1496,8 +1496,8 @@ static void Lbug_1_s(int x, int y) case Xacid_7: case Xacid_8: case Zplayer: - Cave[y][x] = Ybug_s_w; - Next[y][x] = Xbug_2_w; + Cave[x][y] = Ybug_s_w; + Next[x][y] = Xbug_2_w; play_element_sound(x, y, SOUND_bug, Xbug_1_s); return; @@ -1509,10 +1509,10 @@ static void Lbug_1_s(int x, int y) static void Lbug_2_s(int x, int y) { - if (tab_amoeba[Cave[y-1][x]] || - tab_amoeba[Cave[y][x+1]] || - tab_amoeba[Cave[y+1][x]] || - tab_amoeba[Cave[y][x-1]]) + if (tab_amoeba[Cave[x][y-1]] || + tab_amoeba[Cave[x+1][y]] || + tab_amoeba[Cave[x][y+1]] || + tab_amoeba[Cave[x-1][y]]) { Lboom_bug(x, y); @@ -1524,7 +1524,7 @@ static void Lbug_2_s(int x, int y) static void Lbug_w(int x, int y) { - switch (Cave[y][x-1]) + switch (Cave[x-1][y]) { case Xacid_1: case Xacid_2: @@ -1534,12 +1534,12 @@ static void Lbug_w(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ybug_wB; - if (Cave[y-1][x] == Xblank) - Cave[y-1][x] = Xacid_splash_e; - if (Cave[y-1][x-2] == Xblank) - Cave[y-1][x-2] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ybug_wB; + if (Cave[x][y-1] == Xblank) + Cave[x][y-1] = Xacid_splash_e; + if (Cave[x-2][y-1] == Xblank) + Cave[x-2][y-1] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -1549,16 +1549,16 @@ static void Lbug_w(int x, int y) case Xplant: case Yplant: case Zplayer: - Cave[y][x] = Ybug_wB; - Cave[y][x-1] = Ybug_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xbug_1_w; + Cave[x][y] = Ybug_wB; + Cave[x-1][y] = Ybug_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xbug_1_w; play_element_sound(x, y, SOUND_bug, Xbug_1_w); return; default: - Cave[y][x] = Ybug_w_s; - Next[y][x] = Xbug_2_s; + Cave[x][y] = Ybug_w_s; + Next[x][y] = Xbug_2_s; play_element_sound(x, y, SOUND_bug, Xbug_1_w); return; } @@ -1566,17 +1566,17 @@ static void Lbug_w(int x, int y) static void Lbug_1_w(int x, int y) { - if (tab_amoeba[Cave[y-1][x]] || - tab_amoeba[Cave[y][x+1]] || - tab_amoeba[Cave[y+1][x]] || - tab_amoeba[Cave[y][x-1]]) + if (tab_amoeba[Cave[x][y-1]] || + tab_amoeba[Cave[x+1][y]] || + tab_amoeba[Cave[x][y+1]] || + tab_amoeba[Cave[x-1][y]]) { Lboom_bug(x, y); return; } - switch (Cave[y-1][x]) + switch (Cave[x][y-1]) { case Xblank: case Xacid_splash_e: @@ -1592,8 +1592,8 @@ static void Lbug_1_w(int x, int y) case Xacid_7: case Xacid_8: case Zplayer: - Cave[y][x] = Ybug_w_n; - Next[y][x] = Xbug_2_n; + Cave[x][y] = Ybug_w_n; + Next[x][y] = Xbug_2_n; play_element_sound(x, y, SOUND_bug, Xbug_1_w); return; @@ -1605,10 +1605,10 @@ static void Lbug_1_w(int x, int y) static void Lbug_2_w(int x, int y) { - if (tab_amoeba[Cave[y-1][x]] || - tab_amoeba[Cave[y][x+1]] || - tab_amoeba[Cave[y+1][x]] || - tab_amoeba[Cave[y][x-1]]) + if (tab_amoeba[Cave[x][y-1]] || + tab_amoeba[Cave[x+1][y]] || + tab_amoeba[Cave[x][y+1]] || + tab_amoeba[Cave[x-1][y]]) { Lboom_bug(x, y); @@ -1620,7 +1620,7 @@ static void Lbug_2_w(int x, int y) static void Ltank_n(int x, int y) { - switch (Cave[y-1][x]) + switch (Cave[x][y-1]) { case Xacid_1: case Xacid_2: @@ -1630,12 +1630,12 @@ static void Ltank_n(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ytank_nB; - if (Cave[y-2][x+1] == Xblank) - Cave[y-2][x+1] = Xacid_splash_e; - if (Cave[y-2][x-1] == Xblank) - Cave[y-2][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ytank_nB; + if (Cave[x+1][y-2] == Xblank) + Cave[x+1][y-2] = Xacid_splash_e; + if (Cave[x-1][y-2] == Xblank) + Cave[x-1][y-2] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -1645,16 +1645,16 @@ static void Ltank_n(int x, int y) case Xplant: case Yplant: case Zplayer: - Cave[y][x] = Ytank_nB; - Cave[y-1][x] = Ytank_n; - Next[y][x] = Xblank; - Next[y-1][x] = Xtank_1_n; + Cave[x][y] = Ytank_nB; + Cave[x][y-1] = Ytank_n; + Next[x][y] = Xblank; + Next[x][y-1] = Xtank_1_n; play_element_sound(x, y, SOUND_tank, Xtank_1_n); return; default: - Cave[y][x] = Ytank_n_e; - Next[y][x] = Xtank_2_e; + Cave[x][y] = Ytank_n_e; + Next[x][y] = Xtank_2_e; play_element_sound(x, y, SOUND_tank, Xtank_1_n); return; } @@ -1662,17 +1662,17 @@ static void Ltank_n(int x, int y) static void Ltank_1_n(int x, int y) { - if (tab_amoeba[Cave[y-1][x]] || - tab_amoeba[Cave[y][x+1]] || - tab_amoeba[Cave[y+1][x]] || - tab_amoeba[Cave[y][x-1]]) + if (tab_amoeba[Cave[x][y-1]] || + tab_amoeba[Cave[x+1][y]] || + tab_amoeba[Cave[x][y+1]] || + tab_amoeba[Cave[x-1][y]]) { Lboom_tank(x, y); return; } - switch (Cave[y][x-1]) + switch (Cave[x-1][y]) { case Xblank: case Xacid_splash_e: @@ -1688,8 +1688,8 @@ static void Ltank_1_n(int x, int y) case Xacid_7: case Xacid_8: case Zplayer: - Cave[y][x] = Ytank_n_w; - Next[y][x] = Xtank_2_w; + Cave[x][y] = Ytank_n_w; + Next[x][y] = Xtank_2_w; play_element_sound(x, y, SOUND_tank, Xtank_1_n); return; @@ -1701,10 +1701,10 @@ static void Ltank_1_n(int x, int y) static void Ltank_2_n(int x, int y) { - if (tab_amoeba[Cave[y-1][x]] || - tab_amoeba[Cave[y][x+1]] || - tab_amoeba[Cave[y+1][x]] || - tab_amoeba[Cave[y][x-1]]) + if (tab_amoeba[Cave[x][y-1]] || + tab_amoeba[Cave[x+1][y]] || + tab_amoeba[Cave[x][y+1]] || + tab_amoeba[Cave[x-1][y]]) { Lboom_tank(x, y); @@ -1716,7 +1716,7 @@ static void Ltank_2_n(int x, int y) static void Ltank_e(int x, int y) { - switch (Cave[y][x+1]) + switch (Cave[x+1][y]) { case Xacid_1: case Xacid_2: @@ -1726,12 +1726,12 @@ static void Ltank_e(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ytank_eB; - if (Cave[y-1][x+2] == Xblank) - Cave[y-1][x+2] = Xacid_splash_e; - if (Cave[y-1][x] == Xblank) - Cave[y-1][x] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ytank_eB; + if (Cave[x+2][y-1] == Xblank) + Cave[x+2][y-1] = Xacid_splash_e; + if (Cave[x][y-1] == Xblank) + Cave[x][y-1] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -1741,16 +1741,16 @@ static void Ltank_e(int x, int y) case Xplant: case Yplant: case Zplayer: - Cave[y][x] = Ytank_eB; - Cave[y][x+1] = Ytank_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xtank_1_e; + Cave[x][y] = Ytank_eB; + Cave[x+1][y] = Ytank_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xtank_1_e; play_element_sound(x, y, SOUND_tank, Xtank_1_e); return; default: - Cave[y][x] = Ytank_e_s; - Next[y][x] = Xtank_2_s; + Cave[x][y] = Ytank_e_s; + Next[x][y] = Xtank_2_s; play_element_sound(x, y, SOUND_tank, Xtank_1_e); return; } @@ -1758,17 +1758,17 @@ static void Ltank_e(int x, int y) static void Ltank_1_e(int x, int y) { - if (tab_amoeba[Cave[y-1][x]] || - tab_amoeba[Cave[y][x+1]] || - tab_amoeba[Cave[y+1][x]] || - tab_amoeba[Cave[y][x-1]]) + if (tab_amoeba[Cave[x][y-1]] || + tab_amoeba[Cave[x+1][y]] || + tab_amoeba[Cave[x][y+1]] || + tab_amoeba[Cave[x-1][y]]) { Lboom_tank(x, y); return; } - switch (Cave[y-1][x]) + switch (Cave[x][y-1]) { case Xblank: case Xacid_splash_e: @@ -1784,8 +1784,8 @@ static void Ltank_1_e(int x, int y) case Xacid_7: case Xacid_8: case Zplayer: - Cave[y][x] = Ytank_e_n; - Next[y][x] = Xtank_2_n; + Cave[x][y] = Ytank_e_n; + Next[x][y] = Xtank_2_n; play_element_sound(x, y, SOUND_tank, Xtank_1_e); return; @@ -1797,10 +1797,10 @@ static void Ltank_1_e(int x, int y) static void Ltank_2_e(int x, int y) { - if (tab_amoeba[Cave[y-1][x]] || - tab_amoeba[Cave[y][x+1]] || - tab_amoeba[Cave[y+1][x]] || - tab_amoeba[Cave[y][x-1]]) + if (tab_amoeba[Cave[x][y-1]] || + tab_amoeba[Cave[x+1][y]] || + tab_amoeba[Cave[x][y+1]] || + tab_amoeba[Cave[x-1][y]]) { Lboom_tank(x, y); @@ -1812,7 +1812,7 @@ static void Ltank_2_e(int x, int y) static void Ltank_s(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -1822,12 +1822,12 @@ static void Ltank_s(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ytank_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ytank_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -1837,16 +1837,16 @@ static void Ltank_s(int x, int y) case Xplant: case Yplant: case Zplayer: - Cave[y][x] = Ytank_sB; - Cave[y+1][x] = Ytank_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xtank_1_s; + Cave[x][y] = Ytank_sB; + Cave[x][y+1] = Ytank_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xtank_1_s; play_element_sound(x, y, SOUND_tank, Xtank_1_s); return; default: - Cave[y][x] = Ytank_s_w; - Next[y][x] = Xtank_2_w; + Cave[x][y] = Ytank_s_w; + Next[x][y] = Xtank_2_w; play_element_sound(x, y, SOUND_tank, Xtank_1_s); return; } @@ -1854,17 +1854,17 @@ static void Ltank_s(int x, int y) static void Ltank_1_s(int x, int y) { - if (tab_amoeba[Cave[y-1][x]] || - tab_amoeba[Cave[y][x+1]] || - tab_amoeba[Cave[y+1][x]] || - tab_amoeba[Cave[y][x-1]]) + if (tab_amoeba[Cave[x][y-1]] || + tab_amoeba[Cave[x+1][y]] || + tab_amoeba[Cave[x][y+1]] || + tab_amoeba[Cave[x-1][y]]) { Lboom_tank(x, y); return; } - switch (Cave[y][x+1]) + switch (Cave[x+1][y]) { case Xblank: case Xacid_splash_e: @@ -1880,8 +1880,8 @@ static void Ltank_1_s(int x, int y) case Xacid_7: case Xacid_8: case Zplayer: - Cave[y][x] = Ytank_s_e; - Next[y][x] = Xtank_2_e; + Cave[x][y] = Ytank_s_e; + Next[x][y] = Xtank_2_e; play_element_sound(x, y, SOUND_tank, Xtank_1_s); return; @@ -1893,10 +1893,10 @@ static void Ltank_1_s(int x, int y) static void Ltank_2_s(int x, int y) { - if (tab_amoeba[Cave[y-1][x]] || - tab_amoeba[Cave[y][x+1]] || - tab_amoeba[Cave[y+1][x]] || - tab_amoeba[Cave[y][x-1]]) + if (tab_amoeba[Cave[x][y-1]] || + tab_amoeba[Cave[x+1][y]] || + tab_amoeba[Cave[x][y+1]] || + tab_amoeba[Cave[x-1][y]]) { Lboom_tank(x, y); @@ -1908,7 +1908,7 @@ static void Ltank_2_s(int x, int y) static void Ltank_w(int x, int y) { - switch (Cave[y][x-1]) + switch (Cave[x-1][y]) { case Xacid_1: case Xacid_2: @@ -1918,12 +1918,12 @@ static void Ltank_w(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ytank_wB; - if (Cave[y-1][x] == Xblank) - Cave[y-1][x] = Xacid_splash_e; - if (Cave[y-1][x-2] == Xblank) - Cave[y-1][x-2] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ytank_wB; + if (Cave[x][y-1] == Xblank) + Cave[x][y-1] = Xacid_splash_e; + if (Cave[x-2][y-1] == Xblank) + Cave[x-2][y-1] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -1933,16 +1933,16 @@ static void Ltank_w(int x, int y) case Xplant: case Yplant: case Zplayer: - Cave[y][x] = Ytank_wB; - Cave[y][x-1] = Ytank_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xtank_1_w; + Cave[x][y] = Ytank_wB; + Cave[x-1][y] = Ytank_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xtank_1_w; play_element_sound(x, y, SOUND_tank, Xtank_1_w); return; default: - Cave[y][x] = Ytank_w_n; - Next[y][x] = Xtank_2_n; + Cave[x][y] = Ytank_w_n; + Next[x][y] = Xtank_2_n; play_element_sound(x, y, SOUND_tank, Xtank_1_w); return; } @@ -1950,17 +1950,17 @@ static void Ltank_w(int x, int y) static void Ltank_1_w(int x, int y) { - if (tab_amoeba[Cave[y-1][x]] || - tab_amoeba[Cave[y][x+1]] || - tab_amoeba[Cave[y+1][x]] || - tab_amoeba[Cave[y][x-1]]) + if (tab_amoeba[Cave[x][y-1]] || + tab_amoeba[Cave[x+1][y]] || + tab_amoeba[Cave[x][y+1]] || + tab_amoeba[Cave[x-1][y]]) { Lboom_tank(x, y); return; } - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xblank: case Xacid_splash_e: @@ -1976,8 +1976,8 @@ static void Ltank_1_w(int x, int y) case Xacid_7: case Xacid_8: case Zplayer: - Cave[y][x] = Ytank_w_s; - Next[y][x] = Xtank_2_s; + Cave[x][y] = Ytank_w_s; + Next[x][y] = Xtank_2_s; play_element_sound(x, y, SOUND_tank, Xtank_1_w); return; @@ -1989,10 +1989,10 @@ static void Ltank_1_w(int x, int y) static void Ltank_2_w(int x, int y) { - if (tab_amoeba[Cave[y-1][x]] || - tab_amoeba[Cave[y][x+1]] || - tab_amoeba[Cave[y+1][x]] || - tab_amoeba[Cave[y][x-1]]) + if (tab_amoeba[Cave[x][y-1]] || + tab_amoeba[Cave[x+1][y]] || + tab_amoeba[Cave[x][y+1]] || + tab_amoeba[Cave[x-1][y]]) { Lboom_tank(x, y); @@ -2004,7 +2004,7 @@ static void Ltank_2_w(int x, int y) static void Lemerald(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -2014,22 +2014,22 @@ static void Lemerald(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yemerald_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yemerald_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Yemerald_sB; - Cave[y+1][x] = Yemerald_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xemerald_fall; + Cave[x][y] = Yemerald_sB; + Cave[x][y+1] = Yemerald_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xemerald_fall; return; case Xspring: @@ -2087,41 +2087,41 @@ static void Lemerald(int x, int y) case Xroundwall_4: if (RANDOM(2)) { - if (tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) + if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]]) { - Cave[y][x] = Yemerald_eB; - Cave[y][x+1] = Yemerald_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xemerald_pause; + Cave[x][y] = Yemerald_eB; + Cave[x+1][y] = Yemerald_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xemerald_pause; return; } - if (tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) + if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]]) { - Cave[y][x] = Yemerald_wB; - Cave[y][x-1] = Yemerald_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xemerald_pause; + Cave[x][y] = Yemerald_wB; + Cave[x-1][y] = Yemerald_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xemerald_pause; return; } } else { - if (tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) + if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]]) { - Cave[y][x] = Yemerald_wB; - Cave[y][x-1] = Yemerald_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xemerald_pause; + Cave[x][y] = Yemerald_wB; + Cave[x-1][y] = Yemerald_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xemerald_pause; return; } - if (tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) + if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]]) { - Cave[y][x] = Yemerald_eB; - Cave[y][x+1] = Yemerald_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xemerald_pause; + Cave[x][y] = Yemerald_eB; + Cave[x+1][y] = Yemerald_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xemerald_pause; return; } } @@ -2130,7 +2130,7 @@ static void Lemerald(int x, int y) if (++lev.shine_cnt > 50) { lev.shine_cnt = RANDOM(8); - Cave[y][x] = Xemerald_shine; + Cave[x][y] = Xemerald_shine; } return; @@ -2139,7 +2139,7 @@ static void Lemerald(int x, int y) static void Lemerald_pause(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -2149,34 +2149,34 @@ static void Lemerald_pause(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yemerald_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yemerald_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Yemerald_sB; - Cave[y+1][x] = Yemerald_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xemerald_fall; + Cave[x][y] = Yemerald_sB; + Cave[x][y+1] = Yemerald_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xemerald_fall; return; default: - Cave[y][x] = Xemerald; - Next[y][x] = Xemerald; + Cave[x][y] = Xemerald; + Next[x][y] = Xemerald; return; } } static void Lemerald_fall(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -2186,12 +2186,12 @@ static void Lemerald_fall(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yemerald_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yemerald_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -2199,31 +2199,31 @@ static void Lemerald_fall(int x, int y) case Xacid_splash_e: case Xacid_splash_w: case Zplayer: - Cave[y][x] = Yemerald_sB; - Cave[y+1][x] = Yemerald_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xemerald_fall; + Cave[x][y] = Yemerald_sB; + Cave[x][y+1] = Yemerald_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xemerald_fall; return; case Xwonderwall: if (lev.wonderwall_time) { lev.wonderwall_state = 1; - Cave[y][x] = Yemerald_sB; - if (tab_blank[Cave[y+2][x]]) + Cave[x][y] = Yemerald_sB; + if (tab_blank[Cave[x][y+2]]) { - Cave[y+2][x] = Ydiamond_s; - Next[y+2][x] = Xdiamond_fall; + Cave[x][y+2] = Ydiamond_s; + Next[x][y+2] = Xdiamond_fall; } - Next[y][x] = Xblank; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_wonderfall, Xwonderwall); return; } default: - Cave[y][x] = Xemerald; - Next[y][x] = Xemerald; + Cave[x][y] = Xemerald; + Next[x][y] = Xemerald; play_element_sound(x, y, SOUND_diamond, Xemerald); return; } @@ -2231,7 +2231,7 @@ static void Lemerald_fall(int x, int y) static void Ldiamond(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -2241,22 +2241,22 @@ static void Ldiamond(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ydiamond_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ydiamond_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Ydiamond_sB; - Cave[y+1][x] = Ydiamond_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xdiamond_fall; + Cave[x][y] = Ydiamond_sB; + Cave[x][y+1] = Ydiamond_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xdiamond_fall; return; case Xspring: @@ -2314,41 +2314,41 @@ static void Ldiamond(int x, int y) case Xroundwall_4: if (RANDOM(2)) { - if (tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) + if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]]) { - Cave[y][x] = Ydiamond_eB; - Cave[y][x+1] = Ydiamond_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xdiamond_pause; + Cave[x][y] = Ydiamond_eB; + Cave[x+1][y] = Ydiamond_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xdiamond_pause; return; } - if (tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) + if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]]) { - Cave[y][x] = Ydiamond_wB; - Cave[y][x-1] = Ydiamond_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xdiamond_pause; + Cave[x][y] = Ydiamond_wB; + Cave[x-1][y] = Ydiamond_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xdiamond_pause; return; } } else { - if (tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) + if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]]) { - Cave[y][x] = Ydiamond_wB; - Cave[y][x-1] = Ydiamond_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xdiamond_pause; + Cave[x][y] = Ydiamond_wB; + Cave[x-1][y] = Ydiamond_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xdiamond_pause; return; } - if (tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) + if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]]) { - Cave[y][x] = Ydiamond_eB; - Cave[y][x+1] = Ydiamond_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xdiamond_pause; + Cave[x][y] = Ydiamond_eB; + Cave[x+1][y] = Ydiamond_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xdiamond_pause; return; } } @@ -2357,7 +2357,7 @@ static void Ldiamond(int x, int y) if (++lev.shine_cnt > 50) { lev.shine_cnt = RANDOM(8); - Cave[y][x] = Xdiamond_shine; + Cave[x][y] = Xdiamond_shine; } return; @@ -2366,7 +2366,7 @@ static void Ldiamond(int x, int y) static void Ldiamond_pause(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -2376,34 +2376,34 @@ static void Ldiamond_pause(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ydiamond_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ydiamond_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Ydiamond_sB; - Cave[y+1][x] = Ydiamond_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xdiamond_fall; + Cave[x][y] = Ydiamond_sB; + Cave[x][y+1] = Ydiamond_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xdiamond_fall; return; default: - Cave[y][x] = Xdiamond; - Next[y][x] = Xdiamond; + Cave[x][y] = Xdiamond; + Next[x][y] = Xdiamond; return; } } static void Ldiamond_fall(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -2413,12 +2413,12 @@ static void Ldiamond_fall(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ydiamond_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ydiamond_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -2426,31 +2426,31 @@ static void Ldiamond_fall(int x, int y) case Xacid_splash_e: case Xacid_splash_w: case Zplayer: - Cave[y][x] = Ydiamond_sB; - Cave[y+1][x] = Ydiamond_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xdiamond_fall; + Cave[x][y] = Ydiamond_sB; + Cave[x][y+1] = Ydiamond_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xdiamond_fall; return; case Xwonderwall: if (lev.wonderwall_time) { lev.wonderwall_state = 1; - Cave[y][x] = Ydiamond_sB; - if (tab_blank[Cave[y+2][x]]) + Cave[x][y] = Ydiamond_sB; + if (tab_blank[Cave[x][y+2]]) { - Cave[y+2][x] = Ystone_s; - Next[y+2][x] = Xstone_fall; + Cave[x][y+2] = Ystone_s; + Next[x][y+2] = Xstone_fall; } - Next[y][x] = Xblank; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_wonderfall, Xwonderwall); return; } default: - Cave[y][x] = Xdiamond; - Next[y][x] = Xdiamond; + Cave[x][y] = Xdiamond; + Next[x][y] = Xdiamond; play_element_sound(x, y, SOUND_diamond, Xdiamond); return; } @@ -2458,7 +2458,7 @@ static void Ldiamond_fall(int x, int y) static void Lstone(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -2468,12 +2468,12 @@ static void Lstone(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ystone_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ystone_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -2492,17 +2492,17 @@ static void Lstone(int x, int y) case Xfake_acid_7: case Xfake_acid_8: #endif - Cave[y][x] = Ystone_sB; - Cave[y+1][x] = Ystone_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xstone_fall; + Cave[x][y] = Ystone_sB; + Cave[x][y+1] = Ystone_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xstone_fall; return; case Xsand: - Cave[y][x] = Xsand_stonein_1; - Cave[y+1][x] = Xsand_sandstone_1; - Next[y][x] = Xsand_stonein_2; - Next[y+1][x] = Xsand_sandstone_2; + Cave[x][y] = Xsand_stonein_1; + Cave[x][y+1] = Xsand_sandstone_1; + Next[x][y] = Xsand_stonein_2; + Next[x][y+1] = Xsand_sandstone_2; return; case Xspring: @@ -2553,41 +2553,41 @@ static void Lstone(int x, int y) case Xroundwall_4: if (RANDOM(2)) { - if (tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) + if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]]) { - Cave[y][x] = Ystone_eB; - Cave[y][x+1] = Ystone_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xstone_pause; + Cave[x][y] = Ystone_eB; + Cave[x+1][y] = Ystone_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xstone_pause; return; } - if (tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) + if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]]) { - Cave[y][x] = Ystone_wB; - Cave[y][x-1] = Ystone_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xstone_pause; + Cave[x][y] = Ystone_wB; + Cave[x-1][y] = Ystone_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xstone_pause; return; } } else { - if (tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) + if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]]) { - Cave[y][x] = Ystone_wB; - Cave[y][x-1] = Ystone_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xstone_pause; + Cave[x][y] = Ystone_wB; + Cave[x-1][y] = Ystone_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xstone_pause; return; } - if (tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) + if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]]) { - Cave[y][x] = Ystone_eB; - Cave[y][x+1] = Ystone_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xstone_pause; + Cave[x][y] = Ystone_eB; + Cave[x+1][y] = Ystone_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xstone_pause; return; } } @@ -2596,7 +2596,7 @@ static void Lstone(int x, int y) static void Lstone_pause(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -2606,12 +2606,12 @@ static void Lstone_pause(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ystone_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ystone_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -2628,22 +2628,22 @@ static void Lstone_pause(int x, int y) case Xfake_acid_7: case Xfake_acid_8: #endif - Cave[y][x] = Ystone_sB; - Cave[y+1][x] = Ystone_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xstone_fall; + Cave[x][y] = Ystone_sB; + Cave[x][y+1] = Ystone_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xstone_fall; return; default: - Cave[y][x] = Xstone; - Next[y][x] = Xstone; + Cave[x][y] = Xstone; + Next[x][y] = Xstone; return; } } static void Lstone_fall(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -2653,12 +2653,12 @@ static void Lstone_fall(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ystone_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ystone_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -2676,17 +2676,17 @@ static void Lstone_fall(int x, int y) case Xfake_acid_7: case Xfake_acid_8: #endif - Cave[y][x] = Ystone_sB; - Cave[y+1][x] = Ystone_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xstone_fall; + Cave[x][y] = Ystone_sB; + Cave[x][y+1] = Ystone_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xstone_fall; return; case Xnut: case Xnut_pause: - Cave[y+1][x] = Ynut_stone; - Next[y][x] = Xstone; - Next[y+1][x] = Xemerald; + Cave[x][y+1] = Ynut_stone; + Next[x][y] = Xstone; + Next[x][y+1] = Xemerald; play_element_sound(x, y, SOUND_crack, Xnut); score += lev.nut_score; return; @@ -2699,18 +2699,18 @@ static void Lstone_fall(int x, int y) case Xbug_2_e: case Xbug_2_s: case Xbug_2_w: - Cave[y][x] = Ystone_sB; - Cave[y+1][x] = Ybug_stone; - Next[y+1][x] = Znormal; - Boom[y][x-1] = Xemerald; - Boom[y][x] = Xemerald; - Boom[y][x+1] = Xemerald; - Boom[y+1][x-1] = Xemerald; - Boom[y+1][x] = Xdiamond; - Boom[y+1][x+1] = Xemerald; - Boom[y+2][x-1] = Xemerald; - Boom[y+2][x] = Xemerald; - Boom[y+2][x+1] = Xemerald; + Cave[x][y] = Ystone_sB; + Cave[x][y+1] = Ybug_stone; + Next[x][y+1] = Znormal; + Boom[x-1][y] = Xemerald; + Boom[x][y] = Xemerald; + Boom[x+1][y] = Xemerald; + Boom[x-1][y+1] = Xemerald; + Boom[x][y+1] = Xdiamond; + Boom[x+1][y+1] = Xemerald; + Boom[x-1][y+2] = Xemerald; + Boom[x][y+2] = Xemerald; + Boom[x+1][y+2] = Xemerald; #if PLAY_ELEMENT_SOUND play_element_sound(x, y, SOUND_boom, Xstone_fall); #endif @@ -2725,18 +2725,18 @@ static void Lstone_fall(int x, int y) case Xtank_2_e: case Xtank_2_s: case Xtank_2_w: - Cave[y][x] = Ystone_sB; - Cave[y+1][x] = Ytank_stone; - Next[y+1][x] = Znormal; - Boom[y][x-1] = Xblank; - Boom[y][x] = Xblank; - Boom[y][x+1] = Xblank; - Boom[y+1][x-1] = Xblank; - Boom[y+1][x] = Xblank; - Boom[y+1][x+1] = Xblank; - Boom[y+2][x-1] = Xblank; - Boom[y+2][x] = Xblank; - Boom[y+2][x+1] = Xblank; + Cave[x][y] = Ystone_sB; + Cave[x][y+1] = Ytank_stone; + Next[x][y+1] = Znormal; + Boom[x-1][y] = Xblank; + Boom[x][y] = Xblank; + Boom[x+1][y] = Xblank; + Boom[x-1][y+1] = Xblank; + Boom[x][y+1] = Xblank; + Boom[x+1][y+1] = Xblank; + Boom[x-1][y+2] = Xblank; + Boom[x][y+2] = Xblank; + Boom[x+1][y+2] = Xblank; #if PLAY_ELEMENT_SOUND play_element_sound(x, y, SOUND_boom, Xstone_fall); #endif @@ -2746,57 +2746,57 @@ static void Lstone_fall(int x, int y) case Xspring: if (RANDOM(2)) { - switch (Cave[y+1][x+1]) + switch (Cave[x+1][y+1]) { case Xblank: case Xacid_splash_e: case Xacid_splash_w: case Xalien: case Xalien_pause: - Cave[y+1][x] = Xspring_e; + Cave[x][y+1] = Xspring_e; break; default: - Cave[y+1][x] = Xspring_w; + Cave[x][y+1] = Xspring_w; break; } } else { - switch (Cave[y+1][x-1]) + switch (Cave[x-1][y+1]) { case Xblank: case Xacid_splash_e: case Xacid_splash_w: case Xalien: case Xalien_pause: - Cave[y+1][x] = Xspring_w; + Cave[x][y+1] = Xspring_w; break; default: - Cave[y+1][x] = Xspring_e; + Cave[x][y+1] = Xspring_e; break; } } - Next[y][x] = Xstone; + Next[x][y] = Xstone; return; case Xeater_n: case Xeater_e: case Xeater_s: case Xeater_w: - Cave[y][x] = Ystone_sB; - Cave[y+1][x] = Yeater_stone; - Next[y+1][x] = Znormal; - Boom[y][x-1] = lev.eater_array[lev.eater_pos][0]; - Boom[y][x] = lev.eater_array[lev.eater_pos][1]; - Boom[y][x+1] = lev.eater_array[lev.eater_pos][2]; - Boom[y+1][x-1] = lev.eater_array[lev.eater_pos][3]; - Boom[y+1][x] = lev.eater_array[lev.eater_pos][4]; - Boom[y+1][x+1] = lev.eater_array[lev.eater_pos][5]; - Boom[y+2][x-1] = lev.eater_array[lev.eater_pos][6]; - Boom[y+2][x] = lev.eater_array[lev.eater_pos][7]; - Boom[y+2][x+1] = lev.eater_array[lev.eater_pos][8]; + Cave[x][y] = Ystone_sB; + Cave[x][y+1] = Yeater_stone; + Next[x][y+1] = Znormal; + Boom[x-1][y] = lev.eater_array[lev.eater_pos][0]; + Boom[x][y] = lev.eater_array[lev.eater_pos][1]; + Boom[x+1][y] = lev.eater_array[lev.eater_pos][2]; + Boom[x-1][y+1] = lev.eater_array[lev.eater_pos][3]; + Boom[x][y+1] = lev.eater_array[lev.eater_pos][4]; + Boom[x+1][y+1] = lev.eater_array[lev.eater_pos][5]; + Boom[x-1][y+2] = lev.eater_array[lev.eater_pos][6]; + Boom[x][y+2] = lev.eater_array[lev.eater_pos][7]; + Boom[x+1][y+2] = lev.eater_array[lev.eater_pos][8]; #if PLAY_ELEMENT_SOUND play_element_sound(x, y, SOUND_boom, Xstone_fall); #endif @@ -2806,18 +2806,18 @@ static void Lstone_fall(int x, int y) case Xalien: case Xalien_pause: - Cave[y][x] = Ystone_sB; - Cave[y+1][x] = Yalien_stone; - Next[y+1][x] = Znormal; - Boom[y][x-1] = Xblank; - Boom[y][x] = Xblank; - Boom[y][x+1] = Xblank; - Boom[y+1][x-1] = Xblank; - Boom[y+1][x] = Xblank; - Boom[y+1][x+1] = Xblank; - Boom[y+2][x-1] = Xblank; - Boom[y+2][x] = Xblank; - Boom[y+2][x+1] = Xblank; + Cave[x][y] = Ystone_sB; + Cave[x][y+1] = Yalien_stone; + Next[x][y+1] = Znormal; + Boom[x-1][y] = Xblank; + Boom[x][y] = Xblank; + Boom[x+1][y] = Xblank; + Boom[x-1][y+1] = Xblank; + Boom[x][y+1] = Xblank; + Boom[x+1][y+1] = Xblank; + Boom[x-1][y+2] = Xblank; + Boom[x][y+2] = Xblank; + Boom[x+1][y+2] = Xblank; #if PLAY_ELEMENT_SOUND play_element_sound(x, y, SOUND_boom, Xstone_fall); #endif @@ -2826,7 +2826,7 @@ static void Lstone_fall(int x, int y) case Xdiamond: case Xdiamond_pause: - switch (Cave[y+2][x]) + switch (Cave[x][y+2]) { case Xblank: case Xacid_splash_e: @@ -2874,31 +2874,31 @@ static void Lstone_fall(int x, int y) case Xnut_fall: case Xplant: case Yplant: - Next[y][x] = Xstone; + Next[x][y] = Xstone; play_element_sound(x, y, SOUND_stone, Xstone); return; } - Cave[y][x] = Ystone_sB; - Cave[y+1][x] = Ydiamond_stone; - Next[y][x] = Xblank; - Next[y+1][x] = Xstone_pause; + Cave[x][y] = Ystone_sB; + Cave[x][y+1] = Ydiamond_stone; + Next[x][y] = Xblank; + Next[x][y+1] = Xstone_pause; play_element_sound(x, y, SOUND_squash, Xdiamond); return; case Xbomb: case Xbomb_pause: - Cave[y+1][x] = Ybomb_blank; - Next[y+1][x] = Znormal; - Boom[y][x-1] = Xblank; - Boom[y][x] = Xblank; - Boom[y][x+1] = Xblank; - Boom[y+1][x-1] = Xblank; - Boom[y+1][x] = Xblank; - Boom[y+1][x+1] = Xblank; - Boom[y+2][x-1] = Xblank; - Boom[y+2][x] = Xblank; - Boom[y+2][x+1] = Xblank; + Cave[x][y+1] = Ybomb_blank; + Next[x][y+1] = Znormal; + Boom[x-1][y] = Xblank; + Boom[x][y] = Xblank; + Boom[x+1][y] = Xblank; + Boom[x-1][y+1] = Xblank; + Boom[x][y+1] = Xblank; + Boom[x+1][y+1] = Xblank; + Boom[x-1][y+2] = Xblank; + Boom[x][y+2] = Xblank; + Boom[x+1][y+2] = Xblank; #if PLAY_ELEMENT_SOUND play_element_sound(x, y, SOUND_boom, Xstone_fall); #endif @@ -2908,22 +2908,22 @@ static void Lstone_fall(int x, int y) if (lev.wonderwall_time) { lev.wonderwall_state = 1; - Cave[y][x] = Ystone_sB; + Cave[x][y] = Ystone_sB; - if (tab_blank[Cave[y+2][x]]) + if (tab_blank[Cave[x][y+2]]) { - Cave[y+2][x] = Yemerald_s; - Next[y+2][x] = Xemerald_fall; + Cave[x][y+2] = Yemerald_s; + Next[x][y+2] = Xemerald_fall; } - Next[y][x] = Xblank; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_wonderfall, Xwonderwall); return; } default: - Cave[y][x] = Xstone; - Next[y][x] = Xstone; + Cave[x][y] = Xstone; + Next[x][y] = Xstone; play_element_sound(x, y, SOUND_stone, Xstone); return; } @@ -2931,7 +2931,7 @@ static void Lstone_fall(int x, int y) static void Lbomb(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -2941,22 +2941,22 @@ static void Lbomb(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ybomb_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ybomb_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Ybomb_sB; - Cave[y+1][x] = Ybomb_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xbomb_fall; + Cave[x][y] = Ybomb_sB; + Cave[x][y+1] = Ybomb_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xbomb_fall; return; case Xspring: @@ -3005,41 +3005,41 @@ static void Lbomb(int x, int y) case Xroundwall_4: if (RANDOM(2)) { - if (tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) + if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]]) { - Cave[y][x] = Ybomb_eB; - Cave[y][x+1] = Ybomb_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xbomb_pause; + Cave[x][y] = Ybomb_eB; + Cave[x+1][y] = Ybomb_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xbomb_pause; return; } - if (tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) + if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]]) { - Cave[y][x] = Ybomb_wB; - Cave[y][x-1] = Ybomb_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xbomb_pause; + Cave[x][y] = Ybomb_wB; + Cave[x-1][y] = Ybomb_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xbomb_pause; return; } } else { - if (tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) + if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]]) { - Cave[y][x] = Ybomb_wB; - Cave[y][x-1] = Ybomb_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xbomb_pause; + Cave[x][y] = Ybomb_wB; + Cave[x-1][y] = Ybomb_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xbomb_pause; return; } - if (tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) + if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]]) { - Cave[y][x] = Ybomb_eB; - Cave[y][x+1] = Ybomb_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xbomb_pause; + Cave[x][y] = Ybomb_eB; + Cave[x+1][y] = Ybomb_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xbomb_pause; return; } } @@ -3048,7 +3048,7 @@ static void Lbomb(int x, int y) static void Lbomb_pause(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -3058,34 +3058,34 @@ static void Lbomb_pause(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ybomb_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ybomb_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Ybomb_sB; - Cave[y+1][x] = Ybomb_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xbomb_fall; + Cave[x][y] = Ybomb_sB; + Cave[x][y+1] = Ybomb_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xbomb_fall; return; default: - Cave[y][x] = Xbomb; - Next[y][x] = Xbomb; + Cave[x][y] = Xbomb; + Next[x][y] = Xbomb; return; } } static void Lbomb_fall(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -3095,36 +3095,36 @@ static void Lbomb_fall(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ybomb_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ybomb_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Ybomb_sB; - Cave[y+1][x] = Ybomb_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xbomb_fall; + Cave[x][y] = Ybomb_sB; + Cave[x][y+1] = Ybomb_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xbomb_fall; return; default: - Cave[y][x] = Ybomb_blank; - Next[y][x] = Znormal; - Boom[y-1][x-1] = Xblank; - Boom[y-1][x] = Xblank; - Boom[y-1][x+1] = Xblank; - Boom[y][x-1] = Xblank; - Boom[y][x] = Xblank; - Boom[y][x+1] = Xblank; - Boom[y+1][x-1] = Xblank; - Boom[y+1][x] = Xblank; - Boom[y+1][x+1] = Xblank; + Cave[x][y] = Ybomb_blank; + Next[x][y] = Znormal; + Boom[x-1][y-1] = Xblank; + Boom[x][y-1] = Xblank; + Boom[x+1][y-1] = Xblank; + Boom[x-1][y] = Xblank; + Boom[x][y] = Xblank; + Boom[x+1][y] = Xblank; + Boom[x-1][y+1] = Xblank; + Boom[x][y+1] = Xblank; + Boom[x+1][y+1] = Xblank; #if PLAY_ELEMENT_SOUND play_element_sound(x, y, SOUND_boom, Xbomb_fall); #endif @@ -3134,7 +3134,7 @@ static void Lbomb_fall(int x, int y) static void Lnut(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -3144,22 +3144,22 @@ static void Lnut(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ynut_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ynut_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Ynut_sB; - Cave[y+1][x] = Ynut_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xnut_fall; + Cave[x][y] = Ynut_sB; + Cave[x][y+1] = Ynut_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xnut_fall; return; case Xspring: @@ -3208,41 +3208,41 @@ static void Lnut(int x, int y) case Xroundwall_4: if (RANDOM(2)) { - if (tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) + if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]]) { - Cave[y][x] = Ynut_eB; - Cave[y][x+1] = Ynut_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xnut_pause; + Cave[x][y] = Ynut_eB; + Cave[x+1][y] = Ynut_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xnut_pause; return; } - if (tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) + if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]]) { - Cave[y][x] = Ynut_wB; - Cave[y][x-1] = Ynut_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xnut_pause; + Cave[x][y] = Ynut_wB; + Cave[x-1][y] = Ynut_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xnut_pause; return; } } else { - if (tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) + if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]]) { - Cave[y][x] = Ynut_wB; - Cave[y][x-1] = Ynut_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xnut_pause; + Cave[x][y] = Ynut_wB; + Cave[x-1][y] = Ynut_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xnut_pause; return; } - if (tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) + if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]]) { - Cave[y][x] = Ynut_eB; - Cave[y][x+1] = Ynut_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xnut_pause; + Cave[x][y] = Ynut_eB; + Cave[x+1][y] = Ynut_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xnut_pause; return; } } @@ -3251,7 +3251,7 @@ static void Lnut(int x, int y) static void Lnut_pause(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -3261,34 +3261,34 @@ static void Lnut_pause(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ynut_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ynut_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Ynut_sB; - Cave[y+1][x] = Ynut_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xnut_fall; + Cave[x][y] = Ynut_sB; + Cave[x][y+1] = Ynut_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xnut_fall; return; default: - Cave[y][x] = Xnut; - Next[y][x] = Xnut; + Cave[x][y] = Xnut; + Next[x][y] = Xnut; return; } } static void Lnut_fall(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -3298,12 +3298,12 @@ static void Lnut_fall(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ynut_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Ynut_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -3311,15 +3311,15 @@ static void Lnut_fall(int x, int y) case Xacid_splash_e: case Xacid_splash_w: case Zplayer: - Cave[y][x] = Ynut_sB; - Cave[y+1][x] = Ynut_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xnut_fall; + Cave[x][y] = Ynut_sB; + Cave[x][y+1] = Ynut_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xnut_fall; return; default: - Cave[y][x] = Xnut; - Next[y][x] = Xnut; + Cave[x][y] = Xnut; + Next[x][y] = Xnut; play_element_sound(x, y, SOUND_nut, Xnut); return; } @@ -3327,7 +3327,7 @@ static void Lnut_fall(int x, int y) static void Lspring(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -3337,12 +3337,12 @@ static void Lspring(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yspring_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yspring_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -3351,10 +3351,10 @@ static void Lspring(int x, int y) case Xacid_splash_w: case Xplant: case Yplant: - Cave[y][x] = Yspring_sB; - Cave[y+1][x] = Yspring_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xspring_fall; + Cave[x][y] = Yspring_sB; + Cave[x][y+1] = Yspring_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xspring_fall; return; case Xspring: @@ -3403,68 +3403,68 @@ static void Lspring(int x, int y) case Xroundwall_4: if (RANDOM(2)) { - if (tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) + if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]]) { - Cave[y][x] = Yspring_eB; - Cave[y][x+1] = Yspring_e; - if (Cave[y+1][x] == Xbumper) - Cave[y+1][x] = XbumperB; - Next[y][x] = Xblank; + Cave[x][y] = Yspring_eB; + Cave[x+1][y] = Yspring_e; + if (Cave[x][y+1] == Xbumper) + Cave[x][y+1] = XbumperB; + Next[x][y] = Xblank; #ifdef SPRING_ROLL - Next[y][x+1] = Xspring_e; + Next[x+1][y] = Xspring_e; #else - Next[y][x+1] = Xspring_pause; + Next[x+1][y] = Xspring_pause; #endif return; } - if (tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) + if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]]) { - Cave[y][x] = Yspring_wB; - Cave[y][x-1] = Yspring_w; - if (Cave[y+1][x] == Xbumper) - Cave[y+1][x] = XbumperB; - Next[y][x] = Xblank; + Cave[x][y] = Yspring_wB; + Cave[x-1][y] = Yspring_w; + if (Cave[x][y+1] == Xbumper) + Cave[x][y+1] = XbumperB; + Next[x][y] = Xblank; #ifdef SPRING_ROLL - Next[y][x-1] = Xspring_w; + Next[x-1][y] = Xspring_w; #else - Next[y][x-1] = Xspring_pause; + Next[x-1][y] = Xspring_pause; #endif return; } } else { - if (tab_blank[Cave[y][x-1]] && tab_acid[Cave[y+1][x-1]]) + if (tab_blank[Cave[x-1][y]] && tab_acid[Cave[x-1][y+1]]) { - Cave[y][x] = Yspring_wB; - Cave[y][x-1] = Yspring_w; - if (Cave[y+1][x] == Xbumper) - Cave[y+1][x] = XbumperB; - Next[y][x] = Xblank; + Cave[x][y] = Yspring_wB; + Cave[x-1][y] = Yspring_w; + if (Cave[x][y+1] == Xbumper) + Cave[x][y+1] = XbumperB; + Next[x][y] = Xblank; #ifdef SPRING_ROLL - Next[y][x-1] = Xspring_w; + Next[x-1][y] = Xspring_w; #else - Next[y][x-1] = Xspring_pause; + Next[x-1][y] = Xspring_pause; #endif return; } - if (tab_blank[Cave[y][x+1]] && tab_acid[Cave[y+1][x+1]]) + if (tab_blank[Cave[x+1][y]] && tab_acid[Cave[x+1][y+1]]) { - Cave[y][x] = Yspring_eB; - Cave[y][x+1] = Yspring_e; - if (Cave[y+1][x] == Xbumper) - Cave[y+1][x] = XbumperB; - Next[y][x] = Xblank; + Cave[x][y] = Yspring_eB; + Cave[x+1][y] = Yspring_e; + if (Cave[x][y+1] == Xbumper) + Cave[x][y+1] = XbumperB; + Next[x][y] = Xblank; #ifdef SPRING_ROLL - Next[y][x+1] = Xspring_e; + Next[x+1][y] = Xspring_e; #else - Next[y][x+1] = Xspring_pause; + Next[x+1][y] = Xspring_pause; #endif return; } @@ -3474,7 +3474,7 @@ static void Lspring(int x, int y) static void Lspring_pause(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -3484,34 +3484,34 @@ static void Lspring_pause(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yspring_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yspring_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Yspring_sB; - Cave[y+1][x] = Yspring_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xspring_fall; + Cave[x][y] = Yspring_sB; + Cave[x][y+1] = Yspring_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xspring_fall; return; default: - Cave[y][x] = Xspring; - Next[y][x] = Xspring; + Cave[x][y] = Xspring; + Next[x][y] = Xspring; return; } } static void Lspring_e(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -3521,29 +3521,29 @@ static void Lspring_e(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yspring_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yspring_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Yspring_sB; - Cave[y+1][x] = Yspring_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xspring_fall; + Cave[x][y] = Yspring_sB; + Cave[x][y+1] = Yspring_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xspring_fall; return; case Xbumper: - Cave[y+1][x] = XbumperB; + Cave[x][y+1] = XbumperB; } - switch (Cave[y][x+1]) + switch (Cave[x+1][y]) { case Xacid_1: case Xacid_2: @@ -3553,12 +3553,12 @@ static void Lspring_e(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yspring_eB; - if (Cave[y-1][x+2] == Xblank) - Cave[y-1][x+2] = Xacid_splash_e; - if (Cave[y-1][x] == Xblank) - Cave[y-1][x] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yspring_eB; + if (Cave[x+2][y-1] == Xblank) + Cave[x+2][y-1] = Xacid_splash_e; + if (Cave[x][y-1] == Xblank) + Cave[x][y-1] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -3569,10 +3569,10 @@ static void Lspring_e(int x, int y) case Yalien_eB: case Yalien_sB: case Yalien_wB: - Cave[y][x] = Yspring_eB; - Cave[y][x+1] = Yspring_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xspring_e; + Cave[x][y] = Yspring_eB; + Cave[x+1][y] = Yspring_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xspring_e; return; case Xalien: @@ -3581,24 +3581,24 @@ static void Lspring_e(int x, int y) case Yalien_e: case Yalien_s: case Yalien_w: - Cave[y][x] = Yspring_alien_eB; - Cave[y][x+1] = Yspring_alien_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xspring_e; + Cave[x][y] = Yspring_alien_eB; + Cave[x+1][y] = Yspring_alien_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xspring_e; play_element_sound(x, y, SOUND_slurp, Xalien); score += lev.slurp_score; return; case Xbumper: case XbumperB: - Cave[y][x+1] = XbumperB; - Next[y][x] = Xspring_w; + Cave[x+1][y] = XbumperB; + Next[x][y] = Xspring_w; play_element_sound(x, y, SOUND_spring, Xspring); return; default: - Cave[y][x] = Xspring; - Next[y][x] = Xspring; + Cave[x][y] = Xspring; + Next[x][y] = Xspring; play_element_sound(x, y, SOUND_spring, Xspring); return; } @@ -3606,7 +3606,7 @@ static void Lspring_e(int x, int y) static void Lspring_w(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -3616,29 +3616,29 @@ static void Lspring_w(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yspring_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yspring_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Yspring_sB; - Cave[y+1][x] = Yspring_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xspring_fall; + Cave[x][y] = Yspring_sB; + Cave[x][y+1] = Yspring_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xspring_fall; return; case Xbumper: - Cave[y+1][x] = XbumperB; + Cave[x][y+1] = XbumperB; } - switch (Cave[y][x-1]) + switch (Cave[x-1][y]) { case Xacid_1: case Xacid_2: @@ -3648,12 +3648,12 @@ static void Lspring_w(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yspring_wB; - if (Cave[y-1][x] == Xblank) - Cave[y-1][x] = Xacid_splash_e; - if (Cave[y-1][x-2] == Xblank) - Cave[y-1][x-2] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yspring_wB; + if (Cave[x][y-1] == Xblank) + Cave[x][y-1] = Xacid_splash_e; + if (Cave[x-2][y-1] == Xblank) + Cave[x-2][y-1] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -3664,10 +3664,10 @@ static void Lspring_w(int x, int y) case Yalien_eB: case Yalien_sB: case Yalien_wB: - Cave[y][x] = Yspring_wB; - Cave[y][x-1] = Yspring_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xspring_w; + Cave[x][y] = Yspring_wB; + Cave[x-1][y] = Yspring_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xspring_w; return; case Xalien: @@ -3676,24 +3676,24 @@ static void Lspring_w(int x, int y) case Yalien_e: case Yalien_s: case Yalien_w: - Cave[y][x] = Yspring_alien_wB; - Cave[y][x-1] = Yspring_alien_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xspring_w; + Cave[x][y] = Yspring_alien_wB; + Cave[x-1][y] = Yspring_alien_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xspring_w; play_element_sound(x, y, SOUND_slurp, Xalien); score += lev.slurp_score; return; case Xbumper: case XbumperB: - Cave[y][x-1] = XbumperB; - Next[y][x] = Xspring_e; + Cave[x-1][y] = XbumperB; + Next[x][y] = Xspring_e; play_element_sound(x, y, SOUND_spring, Xspring); return; default: - Cave[y][x] = Xspring; - Next[y][x] = Xspring; + Cave[x][y] = Xspring; + Next[x][y] = Xspring; play_element_sound(x, y, SOUND_spring, Xspring); return; } @@ -3701,7 +3701,7 @@ static void Lspring_w(int x, int y) static void Lspring_fall(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -3711,12 +3711,12 @@ static void Lspring_fall(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yspring_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yspring_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -3724,25 +3724,25 @@ static void Lspring_fall(int x, int y) case Xacid_splash_e: case Xacid_splash_w: case Zplayer: - Cave[y][x] = Yspring_sB; - Cave[y+1][x] = Yspring_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xspring_fall; + Cave[x][y] = Yspring_sB; + Cave[x][y+1] = Yspring_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xspring_fall; return; case Xbomb: case Xbomb_pause: - Cave[y+1][x] = Ybomb_blank; - Next[y+1][x] = Znormal; - Boom[y][x-1] = Xblank; - Boom[y][x] = Xblank; - Boom[y][x+1] = Xblank; - Boom[y+1][x-1] = Xblank; - Boom[y+1][x] = Xblank; - Boom[y+1][x+1] = Xblank; - Boom[y+2][x-1] = Xblank; - Boom[y+2][x] = Xblank; - Boom[y+2][x+1] = Xblank; + Cave[x][y+1] = Ybomb_blank; + Next[x][y+1] = Znormal; + Boom[x-1][y] = Xblank; + Boom[x][y] = Xblank; + Boom[x+1][y] = Xblank; + Boom[x-1][y+1] = Xblank; + Boom[x][y+1] = Xblank; + Boom[x+1][y+1] = Xblank; + Boom[x-1][y+2] = Xblank; + Boom[x][y+2] = Xblank; + Boom[x+1][y+2] = Xblank; #if PLAY_ELEMENT_SOUND play_element_sound(x, y, SOUND_boom, Xspring_fall); #endif @@ -3756,18 +3756,18 @@ static void Lspring_fall(int x, int y) case Xbug_2_e: case Xbug_2_s: case Xbug_2_w: - Cave[y][x] = Yspring_sB; - Cave[y+1][x] = Ybug_spring; - Next[y+1][x] = Znormal; - Boom[y][x-1] = Xemerald; - Boom[y][x] = Xemerald; - Boom[y][x+1] = Xemerald; - Boom[y+1][x-1] = Xemerald; - Boom[y+1][x] = Xdiamond; - Boom[y+1][x+1] = Xemerald; - Boom[y+2][x-1] = Xemerald; - Boom[y+2][x] = Xemerald; - Boom[y+2][x+1] = Xemerald; + Cave[x][y] = Yspring_sB; + Cave[x][y+1] = Ybug_spring; + Next[x][y+1] = Znormal; + Boom[x-1][y] = Xemerald; + Boom[x][y] = Xemerald; + Boom[x+1][y] = Xemerald; + Boom[x-1][y+1] = Xemerald; + Boom[x][y+1] = Xdiamond; + Boom[x+1][y+1] = Xemerald; + Boom[x-1][y+2] = Xemerald; + Boom[x][y+2] = Xemerald; + Boom[x+1][y+2] = Xemerald; #if PLAY_ELEMENT_SOUND play_element_sound(x, y, SOUND_boom, Xspring_fall); #endif @@ -3782,18 +3782,18 @@ static void Lspring_fall(int x, int y) case Xtank_2_e: case Xtank_2_s: case Xtank_2_w: - Cave[y][x] = Yspring_sB; - Cave[y+1][x] = Ytank_spring; - Next[y+1][x] = Znormal; - Boom[y][x-1] = Xblank; - Boom[y][x] = Xblank; - Boom[y][x+1] = Xblank; - Boom[y+1][x-1] = Xblank; - Boom[y+1][x] = Xblank; - Boom[y+1][x+1] = Xblank; - Boom[y+2][x-1] = Xblank; - Boom[y+2][x] = Xblank; - Boom[y+2][x+1] = Xblank; + Cave[x][y] = Yspring_sB; + Cave[x][y+1] = Ytank_spring; + Next[x][y+1] = Znormal; + Boom[x-1][y] = Xblank; + Boom[x][y] = Xblank; + Boom[x+1][y] = Xblank; + Boom[x-1][y+1] = Xblank; + Boom[x][y+1] = Xblank; + Boom[x+1][y+1] = Xblank; + Boom[x-1][y+2] = Xblank; + Boom[x][y+2] = Xblank; + Boom[x+1][y+2] = Xblank; #if PLAY_ELEMENT_SOUND play_element_sound(x, y, SOUND_boom, Xspring_fall); #endif @@ -3804,18 +3804,18 @@ static void Lspring_fall(int x, int y) case Xeater_e: case Xeater_s: case Xeater_w: - Cave[y][x] = Yspring_sB; - Cave[y+1][x] = Yeater_spring; - Next[y+1][x] = Znormal; - Boom[y][x-1] = lev.eater_array[lev.eater_pos][0]; - Boom[y][x] = lev.eater_array[lev.eater_pos][1]; - Boom[y][x+1] = lev.eater_array[lev.eater_pos][2]; - Boom[y+1][x-1] = lev.eater_array[lev.eater_pos][3]; - Boom[y+1][x] = lev.eater_array[lev.eater_pos][4]; - Boom[y+1][x+1] = lev.eater_array[lev.eater_pos][5]; - Boom[y+2][x-1] = lev.eater_array[lev.eater_pos][6]; - Boom[y+2][x] = lev.eater_array[lev.eater_pos][7]; - Boom[y+2][x+1] = lev.eater_array[lev.eater_pos][8]; + Cave[x][y] = Yspring_sB; + Cave[x][y+1] = Yeater_spring; + Next[x][y+1] = Znormal; + Boom[x-1][y] = lev.eater_array[lev.eater_pos][0]; + Boom[x][y] = lev.eater_array[lev.eater_pos][1]; + Boom[x+1][y] = lev.eater_array[lev.eater_pos][2]; + Boom[x-1][y+1] = lev.eater_array[lev.eater_pos][3]; + Boom[x][y+1] = lev.eater_array[lev.eater_pos][4]; + Boom[x+1][y+1] = lev.eater_array[lev.eater_pos][5]; + Boom[x-1][y+2] = lev.eater_array[lev.eater_pos][6]; + Boom[x][y+2] = lev.eater_array[lev.eater_pos][7]; + Boom[x+1][y+2] = lev.eater_array[lev.eater_pos][8]; #if PLAY_ELEMENT_SOUND play_element_sound(x, y, SOUND_boom, Xspring_fall); #endif @@ -3825,18 +3825,18 @@ static void Lspring_fall(int x, int y) case Xalien: case Xalien_pause: - Cave[y][x] = Yspring_sB; - Cave[y+1][x] = Yalien_spring; - Next[y+1][x] = Znormal; - Boom[y][x-1] = Xblank; - Boom[y][x] = Xblank; - Boom[y][x+1] = Xblank; - Boom[y+1][x-1] = Xblank; - Boom[y+1][x] = Xblank; - Boom[y+1][x+1] = Xblank; - Boom[y+2][x-1] = Xblank; - Boom[y+2][x] = Xblank; - Boom[y+2][x+1] = Xblank; + Cave[x][y] = Yspring_sB; + Cave[x][y+1] = Yalien_spring; + Next[x][y+1] = Znormal; + Boom[x-1][y] = Xblank; + Boom[x][y] = Xblank; + Boom[x+1][y] = Xblank; + Boom[x-1][y+1] = Xblank; + Boom[x][y+1] = Xblank; + Boom[x+1][y+1] = Xblank; + Boom[x-1][y+2] = Xblank; + Boom[x][y+2] = Xblank; + Boom[x+1][y+2] = Xblank; #if PLAY_ELEMENT_SOUND play_element_sound(x, y, SOUND_boom, Xspring_fall); #endif @@ -3844,8 +3844,8 @@ static void Lspring_fall(int x, int y) return; default: - Cave[y][x] = Xspring; - Next[y][x] = Xspring; + Cave[x][y] = Xspring; + Next[x][y] = Xspring; play_element_sound(x, y, SOUND_spring, Xspring); return; } @@ -3853,7 +3853,7 @@ static void Lspring_fall(int x, int y) static void Lpush_emerald_e(int x, int y) { - switch (Cave[y][x+1]) + switch (Cave[x+1][y]) { case Zborder: case Znormal: @@ -3863,22 +3863,22 @@ static void Lpush_emerald_e(int x, int y) case Xboom_android: case Xboom_1: case Zplayer: - Cave[y][x] = Xemerald; - Next[y][x] = Xemerald; + Cave[x][y] = Xemerald; + Next[x][y] = Xemerald; return; default: - Cave[y][x] = Yemerald_eB; - Cave[y][x+1] = Yemerald_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xemerald_pause; + Cave[x][y] = Yemerald_eB; + Cave[x+1][y] = Yemerald_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xemerald_pause; return; } } static void Lpush_emerald_w(int x, int y) { - switch (Cave[y][x-1]) + switch (Cave[x-1][y]) { case Zborder: case Znormal: @@ -3888,22 +3888,22 @@ static void Lpush_emerald_w(int x, int y) case Xboom_android: case Xboom_1: case Zplayer: - Cave[y][x] = Xemerald; - Next[y][x] = Xemerald; + Cave[x][y] = Xemerald; + Next[x][y] = Xemerald; return; default: - Cave[y][x] = Yemerald_wB; - Cave[y][x-1] = Yemerald_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xemerald_pause; + Cave[x][y] = Yemerald_wB; + Cave[x-1][y] = Yemerald_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xemerald_pause; return; } } static void Lpush_diamond_e(int x, int y) { - switch (Cave[y][x+1]) + switch (Cave[x+1][y]) { case Zborder: case Znormal: @@ -3913,22 +3913,22 @@ static void Lpush_diamond_e(int x, int y) case Xboom_android: case Xboom_1: case Zplayer: - Cave[y][x] = Xdiamond; - Next[y][x] = Xdiamond; + Cave[x][y] = Xdiamond; + Next[x][y] = Xdiamond; return; default: - Cave[y][x] = Ydiamond_eB; - Cave[y][x+1] = Ydiamond_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xdiamond_pause; + Cave[x][y] = Ydiamond_eB; + Cave[x+1][y] = Ydiamond_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xdiamond_pause; return; } } static void Lpush_diamond_w(int x, int y) { - switch (Cave[y][x-1]) + switch (Cave[x-1][y]) { case Zborder: case Znormal: @@ -3938,22 +3938,22 @@ static void Lpush_diamond_w(int x, int y) case Xboom_android: case Xboom_1: case Zplayer: - Cave[y][x] = Xdiamond; - Next[y][x] = Xdiamond; + Cave[x][y] = Xdiamond; + Next[x][y] = Xdiamond; return; default: - Cave[y][x] = Ydiamond_wB; - Cave[y][x-1] = Ydiamond_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xdiamond_pause; + Cave[x][y] = Ydiamond_wB; + Cave[x-1][y] = Ydiamond_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xdiamond_pause; return; } } static void Lpush_stone_e(int x, int y) { - switch (Cave[y][x+1]) + switch (Cave[x+1][y]) { case Zborder: case Znormal: @@ -3963,22 +3963,22 @@ static void Lpush_stone_e(int x, int y) case Xboom_android: case Xboom_1: case Zplayer: - Cave[y][x] = Xstone; - Next[y][x] = Xstone; + Cave[x][y] = Xstone; + Next[x][y] = Xstone; return; default: - Cave[y][x] = Ystone_eB; - Cave[y][x+1] = Ystone_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xstone_pause; + Cave[x][y] = Ystone_eB; + Cave[x+1][y] = Ystone_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xstone_pause; return; } } static void Lpush_stone_w(int x, int y) { - switch (Cave[y][x-1]) + switch (Cave[x-1][y]) { case Zborder: case Znormal: @@ -3988,22 +3988,22 @@ static void Lpush_stone_w(int x, int y) case Xboom_android: case Xboom_1: case Zplayer: - Cave[y][x] = Xstone; - Next[y][x] = Xstone; + Cave[x][y] = Xstone; + Next[x][y] = Xstone; return; default: - Cave[y][x] = Ystone_wB; - Cave[y][x-1] = Ystone_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xstone_pause; + Cave[x][y] = Ystone_wB; + Cave[x-1][y] = Ystone_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xstone_pause; return; } } static void Lpush_bomb_e(int x, int y) { - switch (Cave[y][x+1]) + switch (Cave[x+1][y]) { case Zborder: case Znormal: @@ -4013,22 +4013,22 @@ static void Lpush_bomb_e(int x, int y) case Xboom_android: case Xboom_1: case Zplayer: - Cave[y][x] = Xbomb; - Next[y][x] = Xbomb; + Cave[x][y] = Xbomb; + Next[x][y] = Xbomb; return; default: - Cave[y][x] = Ybomb_eB; - Cave[y][x+1] = Ybomb_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xbomb_pause; + Cave[x][y] = Ybomb_eB; + Cave[x+1][y] = Ybomb_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xbomb_pause; return; } } static void Lpush_bomb_w(int x, int y) { - switch (Cave[y][x-1]) + switch (Cave[x-1][y]) { case Zborder: case Znormal: @@ -4038,22 +4038,22 @@ static void Lpush_bomb_w(int x, int y) case Xboom_android: case Xboom_1: case Zplayer: - Cave[y][x] = Xbomb; - Next[y][x] = Xbomb; + Cave[x][y] = Xbomb; + Next[x][y] = Xbomb; return; default: - Cave[y][x] = Ybomb_wB; - Cave[y][x-1] = Ybomb_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xbomb_pause; + Cave[x][y] = Ybomb_wB; + Cave[x-1][y] = Ybomb_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xbomb_pause; return; } } static void Lpush_nut_e(int x, int y) { - switch (Cave[y][x+1]) + switch (Cave[x+1][y]) { case Zborder: case Znormal: @@ -4063,22 +4063,22 @@ static void Lpush_nut_e(int x, int y) case Xboom_android: case Xboom_1: case Zplayer: - Cave[y][x] = Xnut; - Next[y][x] = Xnut; + Cave[x][y] = Xnut; + Next[x][y] = Xnut; return; default: - Cave[y][x] = Ynut_eB; - Cave[y][x+1] = Ynut_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xnut_pause; + Cave[x][y] = Ynut_eB; + Cave[x+1][y] = Ynut_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xnut_pause; return; } } static void Lpush_nut_w(int x, int y) { - switch (Cave[y][x-1]) + switch (Cave[x-1][y]) { case Zborder: case Znormal: @@ -4088,22 +4088,22 @@ static void Lpush_nut_w(int x, int y) case Xboom_android: case Xboom_1: case Zplayer: - Cave[y][x] = Xnut; - Next[y][x] = Xnut; + Cave[x][y] = Xnut; + Next[x][y] = Xnut; return; default: - Cave[y][x] = Ynut_wB; - Cave[y][x-1] = Ynut_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xnut_pause; + Cave[x][y] = Ynut_wB; + Cave[x-1][y] = Ynut_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xnut_pause; return; } } static void Lpush_spring_e(int x, int y) { - switch (Cave[y][x+1]) + switch (Cave[x+1][y]) { case Zborder: case Znormal: @@ -4113,22 +4113,22 @@ static void Lpush_spring_e(int x, int y) case Xboom_android: case Xboom_1: case Zplayer: - Cave[y][x] = Xspring; - Next[y][x] = Xspring; + Cave[x][y] = Xspring; + Next[x][y] = Xspring; return; default: - Cave[y][x] = Yspring_eB; - Cave[y][x+1] = Yspring_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xspring_e; + Cave[x][y] = Yspring_eB; + Cave[x+1][y] = Yspring_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xspring_e; return; } } static void Lpush_spring_w(int x, int y) { - switch (Cave[y][x-1]) + switch (Cave[x-1][y]) { case Zborder: case Znormal: @@ -4138,15 +4138,15 @@ static void Lpush_spring_w(int x, int y) case Xboom_android: case Xboom_1: case Zplayer: - Cave[y][x] = Xspring; - Next[y][x] = Xspring; + Cave[x][y] = Xspring; + Next[x][y] = Xspring; return; default: - Cave[y][x] = Yspring_wB; - Cave[y][x-1] = Yspring_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xspring_w; + Cave[x][y] = Yspring_wB; + Cave[x-1][y] = Yspring_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xspring_w; return; } } @@ -4159,7 +4159,7 @@ static void Lballoon(int x, int y) switch (lev.wind_direction) { case 0: /* north */ - switch (Cave[y-1][x]) + switch (Cave[x][y-1]) { case Xacid_1: case Xacid_2: @@ -4169,28 +4169,28 @@ static void Lballoon(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yballoon_nB; - if (Cave[y-2][x+1] == Xblank) - Cave[y-2][x+1] = Xacid_splash_e; - if (Cave[y-2][x-1] == Xblank) - Cave[y-2][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yballoon_nB; + if (Cave[x+1][y-2] == Xblank) + Cave[x+1][y-2] = Xacid_splash_e; + if (Cave[x-1][y-2] == Xblank) + Cave[x-1][y-2] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Yballoon_nB; - Cave[y-1][x] = Yballoon_n; - Next[y][x] = Xblank; - Next[y-1][x] = Xballoon; + Cave[x][y] = Yballoon_nB; + Cave[x][y-1] = Yballoon_n; + Next[x][y] = Xblank; + Next[x][y-1] = Xballoon; return; } break; case 1: /* east */ - switch (Cave[y][x+1]) + switch (Cave[x+1][y]) { case Xacid_1: case Xacid_2: @@ -4200,28 +4200,28 @@ static void Lballoon(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yballoon_eB; - if (Cave[y-1][x+2] == Xblank) - Cave[y-1][x+2] = Xacid_splash_e; - if (Cave[y-1][x] == Xblank) - Cave[y-1][x] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yballoon_eB; + if (Cave[x+2][y-1] == Xblank) + Cave[x+2][y-1] = Xacid_splash_e; + if (Cave[x][y-1] == Xblank) + Cave[x][y-1] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Yballoon_eB; - Cave[y][x+1] = Yballoon_e; - Next[y][x] = Xblank; - Next[y][x+1] = Xballoon; + Cave[x][y] = Yballoon_eB; + Cave[x+1][y] = Yballoon_e; + Next[x][y] = Xblank; + Next[x+1][y] = Xballoon; return; } break; case 2: /* south */ - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -4231,28 +4231,28 @@ static void Lballoon(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yballoon_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yballoon_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Yballoon_sB; - Cave[y+1][x] = Yballoon_s; - Next[y][x] = Xblank; - Next[y+1][x] = Xballoon; + Cave[x][y] = Yballoon_sB; + Cave[x][y+1] = Yballoon_s; + Next[x][y] = Xblank; + Next[x][y+1] = Xballoon; return; } break; case 3: /* west */ - switch (Cave[y][x-1]) + switch (Cave[x-1][y]) { case Xacid_1: case Xacid_2: @@ -4262,22 +4262,22 @@ static void Lballoon(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Yballoon_wB; - if (Cave[y-1][x] == Xblank) - Cave[y-1][x] = Xacid_splash_e; - if (Cave[y-1][x-2] == Xblank) - Cave[y-1][x-2] = Xacid_splash_w; - Next[y][x] = Xblank; + Cave[x][y] = Yballoon_wB; + if (Cave[x][y-1] == Xblank) + Cave[x][y-1] = Xacid_splash_e; + if (Cave[x-2][y-1] == Xblank) + Cave[x-2][y-1] = Xacid_splash_w; + Next[x][y] = Xblank; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Yballoon_wB; - Cave[y][x-1] = Yballoon_w; - Next[y][x] = Xblank; - Next[y][x-1] = Xballoon; + Cave[x][y] = Yballoon_wB; + Cave[x-1][y] = Yballoon_w; + Next[x][y] = Xblank; + Next[x-1][y] = Xballoon; return; } break; @@ -4294,73 +4294,73 @@ static void Lball_common(int x, int y) { case 0: if (lev.ball_array[lev.ball_pos][0] != Xblank && - tab_blank[Cave[y-1][x-1]]) + tab_blank[Cave[x-1][y-1]]) { - Cave[y-1][x-1] = Yball_blank; - Next[y-1][x-1] = lev.ball_array[lev.ball_pos][0]; + Cave[x-1][y-1] = Yball_blank; + Next[x-1][y-1] = lev.ball_array[lev.ball_pos][0]; } break; case 1: if (lev.ball_array[lev.ball_pos][1] != Xblank && - tab_blank[Cave[y-1][x]]) + tab_blank[Cave[x][y-1]]) { - Cave[y-1][x] = Yball_blank; - Next[y-1][x] = lev.ball_array[lev.ball_pos][1]; + Cave[x][y-1] = Yball_blank; + Next[x][y-1] = lev.ball_array[lev.ball_pos][1]; } break; case 2: if (lev.ball_array[lev.ball_pos][2] != Xblank && - tab_blank[Cave[y-1][x+1]]) + tab_blank[Cave[x+1][y-1]]) { - Cave[y-1][x+1] = Yball_blank; - Next[y-1][x+1] = lev.ball_array[lev.ball_pos][2]; + Cave[x+1][y-1] = Yball_blank; + Next[x+1][y-1] = lev.ball_array[lev.ball_pos][2]; } break; case 3: if (lev.ball_array[lev.ball_pos][3] != Xblank && - tab_blank[Cave[y][x-1]]) + tab_blank[Cave[x-1][y]]) { - Cave[y][x-1] = Yball_blank; - Next[y][x-1] = lev.ball_array[lev.ball_pos][3]; + Cave[x-1][y] = Yball_blank; + Next[x-1][y] = lev.ball_array[lev.ball_pos][3]; } break; case 4: if (lev.ball_array[lev.ball_pos][4] != Xblank && - tab_blank[Cave[y][x+1]]) + tab_blank[Cave[x+1][y]]) { - Cave[y][x+1] = Yball_blank; - Next[y][x+1] = lev.ball_array[lev.ball_pos][4]; + Cave[x+1][y] = Yball_blank; + Next[x+1][y] = lev.ball_array[lev.ball_pos][4]; } break; case 5: if (lev.ball_array[lev.ball_pos][5] != Xblank && - tab_blank[Cave[y+1][x-1]]) + tab_blank[Cave[x-1][y+1]]) { - Cave[y+1][x-1] = Yball_blank; - Next[y+1][x-1] = lev.ball_array[lev.ball_pos][5]; + Cave[x-1][y+1] = Yball_blank; + Next[x-1][y+1] = lev.ball_array[lev.ball_pos][5]; } break; case 6: if (lev.ball_array[lev.ball_pos][6] != Xblank && - tab_blank[Cave[y+1][x]]) + tab_blank[Cave[x][y+1]]) { - Cave[y+1][x] = Yball_blank; - Next[y+1][x] = lev.ball_array[lev.ball_pos][6]; + Cave[x][y+1] = Yball_blank; + Next[x][y+1] = lev.ball_array[lev.ball_pos][6]; } break; case 7: if (lev.ball_array[lev.ball_pos][7] != Xblank && - tab_blank[Cave[y+1][x+1]]) + tab_blank[Cave[x+1][y+1]]) { - Cave[y+1][x+1] = Yball_blank; - Next[y+1][x+1] = lev.ball_array[lev.ball_pos][7]; + Cave[x+1][y+1] = Yball_blank; + Next[x+1][y+1] = lev.ball_array[lev.ball_pos][7]; } break; } @@ -4368,59 +4368,59 @@ static void Lball_common(int x, int y) else { if (lev.ball_array[lev.ball_pos][0] != Xblank && - tab_blank[Cave[y-1][x-1]]) + tab_blank[Cave[x-1][y-1]]) { - Cave[y-1][x-1] = Yball_blank; - Next[y-1][x-1] = lev.ball_array[lev.ball_pos][0]; + Cave[x-1][y-1] = Yball_blank; + Next[x-1][y-1] = lev.ball_array[lev.ball_pos][0]; } if (lev.ball_array[lev.ball_pos][1] != Xblank && - tab_blank[Cave[y-1][x]]) + tab_blank[Cave[x][y-1]]) { - Cave[y-1][x] = Yball_blank; - Next[y-1][x] = lev.ball_array[lev.ball_pos][1]; + Cave[x][y-1] = Yball_blank; + Next[x][y-1] = lev.ball_array[lev.ball_pos][1]; } if (lev.ball_array[lev.ball_pos][2] != Xblank && - tab_blank[Cave[y-1][x+1]]) + tab_blank[Cave[x+1][y-1]]) { - Cave[y-1][x+1] = Yball_blank; - Next[y-1][x+1] = lev.ball_array[lev.ball_pos][2]; + Cave[x+1][y-1] = Yball_blank; + Next[x+1][y-1] = lev.ball_array[lev.ball_pos][2]; } if (lev.ball_array[lev.ball_pos][3] != Xblank && - tab_blank[Cave[y][x-1]]) + tab_blank[Cave[x-1][y]]) { - Cave[y][x-1] = Yball_blank; - Next[y][x-1] = lev.ball_array[lev.ball_pos][3]; + Cave[x-1][y] = Yball_blank; + Next[x-1][y] = lev.ball_array[lev.ball_pos][3]; } if (lev.ball_array[lev.ball_pos][4] != Xblank && - tab_blank[Cave[y][x+1]]) + tab_blank[Cave[x+1][y]]) { - Cave[y][x+1] = Yball_blank; - Next[y][x+1] = lev.ball_array[lev.ball_pos][4]; + Cave[x+1][y] = Yball_blank; + Next[x+1][y] = lev.ball_array[lev.ball_pos][4]; } if (lev.ball_array[lev.ball_pos][5] != Xblank && - tab_blank[Cave[y+1][x-1]]) + tab_blank[Cave[x-1][y+1]]) { - Cave[y+1][x-1] = Yball_blank; - Next[y+1][x-1] = lev.ball_array[lev.ball_pos][5]; + Cave[x-1][y+1] = Yball_blank; + Next[x-1][y+1] = lev.ball_array[lev.ball_pos][5]; } if (lev.ball_array[lev.ball_pos][6] != Xblank && - tab_blank[Cave[y+1][x]]) + tab_blank[Cave[x][y+1]]) { - Cave[y+1][x] = Yball_blank; - Next[y+1][x] = lev.ball_array[lev.ball_pos][6]; + Cave[x][y+1] = Yball_blank; + Next[x][y+1] = lev.ball_array[lev.ball_pos][6]; } if (lev.ball_array[lev.ball_pos][7] != Xblank && - tab_blank[Cave[y+1][x+1]]) + tab_blank[Cave[x+1][y+1]]) { - Cave[y+1][x+1] = Yball_blank; - Next[y+1][x+1] = lev.ball_array[lev.ball_pos][7]; + Cave[x+1][y+1] = Yball_blank; + Next[x+1][y+1] = lev.ball_array[lev.ball_pos][7]; } } @@ -4432,8 +4432,8 @@ static void Lball_1(int x, int y) if (lev.ball_state == 0) return; - Cave[y][x] = Yball_1; - Next[y][x] = Xball_2; + Cave[x][y] = Yball_1; + Next[x][y] = Xball_2; if (lev.ball_cnt) return; @@ -4445,8 +4445,8 @@ static void Lball_2(int x, int y) if (lev.ball_state == 0) return; - Cave[y][x] = Yball_2; - Next[y][x] = Xball_1; + Cave[x][y] = Yball_2; + Next[x][y] = Xball_1; if (lev.ball_cnt) return; @@ -4455,14 +4455,14 @@ static void Lball_2(int x, int y) static void Ldrip(int x, int y) { - Next[y][x] = Xdrip_fall; + Next[x][y] = Xdrip_fall; } static void Ldrip_fall(int x, int y) { int temp; - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -4472,12 +4472,12 @@ static void Ldrip_fall(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Ydrip_1_sB; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xdrip_stretchB; + Cave[x][y] = Ydrip_1_sB; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xdrip_stretchB; play_element_sound(x, y, SOUND_acid, Xacid_1); return; @@ -4487,10 +4487,10 @@ static void Ldrip_fall(int x, int y) case Xplant: case Yplant: case Zplayer: - Cave[y][x] = Ydrip_1_sB; - Cave[y+1][x] = Ydrip_1_s; - Next[y][x] = Xdrip_stretchB; - Next[y+1][x] = Xdrip_stretch; + Cave[x][y] = Ydrip_1_sB; + Cave[x][y+1] = Ydrip_1_s; + Next[x][y] = Xdrip_stretchB; + Next[x][y+1] = Xdrip_stretch; return; default: @@ -4506,8 +4506,8 @@ static void Ldrip_fall(int x, int y) case 7: temp = Xamoeba_8; break; } - Cave[y][x] = temp; - Next[y][x] = temp; + Cave[x][y] = temp; + Next[x][y] = temp; play_element_sound(x, y, SOUND_drip, Xdrip_fall); return; } @@ -4515,28 +4515,28 @@ static void Ldrip_fall(int x, int y) static void Ldrip_stretch(int x, int y) { - Cave[y][x] = Ydrip_2_s; - Next[y][x] = Xdrip_fall; + Cave[x][y] = Ydrip_2_s; + Next[x][y] = Xdrip_fall; } static void Ldrip_stretchB(int x, int y) { - Cave[y][x] = Ydrip_2_sB; - Next[y][x] = Xblank; + Cave[x][y] = Ydrip_2_sB; + Next[x][y] = Xblank; } static void Lwonderwall(int x, int y) { if (lev.wonderwall_time && lev.wonderwall_state) { - Cave[y][x] = XwonderwallB; + Cave[x][y] = XwonderwallB; play_element_sound(x, y, SOUND_wonder, Xwonderwall); } } static void Lsand_stone(int x, int y) { - switch (Cave[y+1][x]) + switch (Cave[x][y+1]) { case Xacid_1: case Xacid_2: @@ -4546,145 +4546,145 @@ static void Lsand_stone(int x, int y) case Xacid_6: case Xacid_7: case Xacid_8: - Cave[y][x] = Xsand_stonesand_quickout_1; - if (Cave[y][x+1] == Xblank) - Cave[y][x+1] = Xacid_splash_e; - if (Cave[y][x-1] == Xblank) - Cave[y][x-1] = Xacid_splash_w; - Next[y][x] = Xsand_stonesand_quickout_2; + Cave[x][y] = Xsand_stonesand_quickout_1; + if (Cave[x+1][y] == Xblank) + Cave[x+1][y] = Xacid_splash_e; + if (Cave[x-1][y] == Xblank) + Cave[x-1][y] = Xacid_splash_w; + Next[x][y] = Xsand_stonesand_quickout_2; play_element_sound(x, y, SOUND_acid, Xacid_1); return; case Xblank: case Xacid_splash_e: case Xacid_splash_w: - Cave[y][x] = Xsand_stonesand_quickout_1; - Cave[y+1][x] = Xsand_stoneout_1; - Next[y][x] = Xsand_stonesand_quickout_2; - Next[y+1][x] = Xsand_stoneout_2; + Cave[x][y] = Xsand_stonesand_quickout_1; + Cave[x][y+1] = Xsand_stoneout_1; + Next[x][y] = Xsand_stonesand_quickout_2; + Next[x][y+1] = Xsand_stoneout_2; return; case Xsand: - Cave[y][x] = Xsand_stonesand_1; - Cave[y+1][x] = Xsand_sandstone_1; - Next[y][x] = Xsand_stonesand_2; - Next[y+1][x] = Xsand_sandstone_2; + Cave[x][y] = Xsand_stonesand_1; + Cave[x][y+1] = Xsand_sandstone_1; + Next[x][y] = Xsand_stonesand_2; + Next[x][y+1] = Xsand_sandstone_2; return; } } static void Lsand_stonein_1(int x, int y) { - Next[y][x] = Xsand_stonein_2; + Next[x][y] = Xsand_stonein_2; } static void Lsand_stonein_2(int x, int y) { - Next[y][x] = Xsand_stonein_3; + Next[x][y] = Xsand_stonein_3; } static void Lsand_stonein_3(int x, int y) { - Next[y][x] = Xsand_stonein_4; + Next[x][y] = Xsand_stonein_4; } static void Lsand_stonein_4(int x, int y) { - Next[y][x] = Xblank; + Next[x][y] = Xblank; } static void Lsand_stonesand_1(int x, int y) { - Next[y][x] = Xsand_stonesand_2; + Next[x][y] = Xsand_stonesand_2; } static void Lsand_stonesand_2(int x, int y) { - Next[y][x] = Xsand_stonesand_3; + Next[x][y] = Xsand_stonesand_3; } static void Lsand_stonesand_3(int x, int y) { - Next[y][x] = Xsand_stonesand_4; + Next[x][y] = Xsand_stonesand_4; } static void Lsand_stonesand_4(int x, int y) { - Next[y][x] = Xsand; + Next[x][y] = Xsand; } #ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS static void Lsand_stonesand_quickout_1(int x, int y) { - Next[y][x] = Xsand_stonesand_quickout_2; + Next[x][y] = Xsand_stonesand_quickout_2; } static void Lsand_stonesand_quickout_2(int x, int y) { - Next[y][x] = Xsand; + Next[x][y] = Xsand; } #endif static void Lsand_stoneout_1(int x, int y) { - Next[y][x] = Xsand_stoneout_2; + Next[x][y] = Xsand_stoneout_2; } static void Lsand_stoneout_2(int x, int y) { - Next[y][x] = Xstone_fall; + Next[x][y] = Xstone_fall; } static void Lsand_sandstone_1(int x, int y) { - Next[y][x] = Xsand_sandstone_2; + Next[x][y] = Xsand_sandstone_2; } static void Lsand_sandstone_2(int x, int y) { - Next[y][x] = Xsand_sandstone_3; + Next[x][y] = Xsand_sandstone_3; } static void Lsand_sandstone_3(int x, int y) { - Next[y][x] = Xsand_sandstone_4; + Next[x][y] = Xsand_sandstone_4; } static void Lsand_sandstone_4(int x, int y) { - Next[y][x] = Xsand_stone; + Next[x][y] = Xsand_stone; } static void Lslidewall_ns(int x, int y) { - if (tab_blank[Cave[y-1][x]]) + if (tab_blank[Cave[x][y-1]]) { - Cave[y-1][x] = Yslidewall_ns_blank; - Next[y-1][x] = Xslidewall_ns; + Cave[x][y-1] = Yslidewall_ns_blank; + Next[x][y-1] = Xslidewall_ns; play_element_sound(x, y, SOUND_slidewall, Xslidewall_ns); } - if (tab_blank[Cave[y+1][x]]) + if (tab_blank[Cave[x][y+1]]) { - Cave[y+1][x] = Yslidewall_ns_blank; - Next[y+1][x] = Xslidewall_ns; + Cave[x][y+1] = Yslidewall_ns_blank; + Next[x][y+1] = Xslidewall_ns; play_element_sound(x, y, SOUND_slidewall, Xslidewall_ns); } } static void Lslidewall_ew(int x, int y) { - if (tab_blank[Cave[y][x+1]]) + if (tab_blank[Cave[x+1][y]]) { - Cave[y][x+1] = Yslidewall_ew_blank; - Next[y][x+1] = Xslidewall_ew; + Cave[x+1][y] = Yslidewall_ew_blank; + Next[x+1][y] = Xslidewall_ew; play_element_sound(x, y, SOUND_slidewall, Xslidewall_ew); } - if (tab_blank[Cave[y][x-1]]) + if (tab_blank[Cave[x-1][y]]) { - Cave[y][x-1] = Yslidewall_ew_blank; - Next[y][x-1] = Xslidewall_ew; + Cave[x-1][y] = Yslidewall_ew_blank; + Next[x-1][y] = Xslidewall_ew; play_element_sound(x, y, SOUND_slidewall, Xslidewall_ew); } } @@ -4697,18 +4697,18 @@ static void Lexit(int x, int y) switch (RANDOM(64) / 21) { case 0: - Cave[y][x] = Xexit_1; - Next[y][x] = Xexit_2; + Cave[x][y] = Xexit_1; + Next[x][y] = Xexit_2; break; case 1: - Cave[y][x] = Xexit_2; - Next[y][x] = Xexit_3; + Cave[x][y] = Xexit_2; + Next[x][y] = Xexit_3; break; default: - Cave[y][x] = Xexit_3; - Next[y][x] = Xexit_1; + Cave[x][y] = Xexit_3; + Next[x][y] = Xexit_1; break; } @@ -4717,220 +4717,220 @@ static void Lexit(int x, int y) static void Lexit_1(int x, int y) { - Next[y][x] = Xexit_2; + Next[x][y] = Xexit_2; } static void Lexit_2(int x, int y) { - Next[y][x] = Xexit_3; + Next[x][y] = Xexit_3; } static void Lexit_3(int x, int y) { - Next[y][x] = Xexit_1; + Next[x][y] = Xexit_1; } static void Lacid_1(int x, int y) { - Next[y][x] = Xacid_2; + Next[x][y] = Xacid_2; } static void Lacid_2(int x, int y) { - Next[y][x] = Xacid_3; + Next[x][y] = Xacid_3; } static void Lacid_3(int x, int y) { - Next[y][x] = Xacid_4; + Next[x][y] = Xacid_4; } static void Lacid_4(int x, int y) { - Next[y][x] = Xacid_5; + Next[x][y] = Xacid_5; } static void Lacid_5(int x, int y) { - Next[y][x] = Xacid_6; + Next[x][y] = Xacid_6; } static void Lacid_6(int x, int y) { - Next[y][x] = Xacid_7; + Next[x][y] = Xacid_7; } static void Lacid_7(int x, int y) { - Next[y][x] = Xacid_8; + Next[x][y] = Xacid_8; } static void Lacid_8(int x, int y) { - Next[y][x] = Xacid_1; + Next[x][y] = Xacid_1; } #ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS static void Lfake_acid_1(int x, int y) { - Next[y][x] = Xfake_acid_2; + Next[x][y] = Xfake_acid_2; } static void Lfake_acid_2(int x, int y) { - Next[y][x] = Xfake_acid_3; + Next[x][y] = Xfake_acid_3; } static void Lfake_acid_3(int x, int y) { - Next[y][x] = Xfake_acid_4; + Next[x][y] = Xfake_acid_4; } static void Lfake_acid_4(int x, int y) { - Next[y][x] = Xfake_acid_5; + Next[x][y] = Xfake_acid_5; } static void Lfake_acid_5(int x, int y) { - Next[y][x] = Xfake_acid_6; + Next[x][y] = Xfake_acid_6; } static void Lfake_acid_6(int x, int y) { - Next[y][x] = Xfake_acid_7; + Next[x][y] = Xfake_acid_7; } static void Lfake_acid_7(int x, int y) { - Next[y][x] = Xfake_acid_8; + Next[x][y] = Xfake_acid_8; } static void Lfake_acid_8(int x, int y) { - Next[y][x] = Xfake_acid_1; + Next[x][y] = Xfake_acid_1; } #endif static void Lpause(int x, int y) { - Next[y][x] = Xblank; + Next[x][y] = Xblank; } static void Ldynamite_1(int x, int y) { play_element_sound(x, y, SOUND_tick, Xdynamite_1); - Next[y][x] = Xdynamite_2; + Next[x][y] = Xdynamite_2; } static void Ldynamite_2(int x, int y) { play_element_sound(x, y, SOUND_tick, Xdynamite_2); - Next[y][x] = Xdynamite_3; + Next[x][y] = Xdynamite_3; } static void Ldynamite_3(int x, int y) { play_element_sound(x, y, SOUND_tick, Xdynamite_3); - Next[y][x] = Xdynamite_4; + Next[x][y] = Xdynamite_4; } static void Ldynamite_4(int x, int y) { play_element_sound(x, y, SOUND_tick, Xdynamite_4); - Next[y][x] = Zdynamite; - Boom[y-1][x-1] = Xblank; - Boom[y-1][x] = Xblank; - Boom[y-1][x+1] = Xblank; - Boom[y][x-1] = Xblank; - Boom[y][x] = Xblank; - Boom[y][x+1] = Xblank; - Boom[y+1][x-1] = Xblank; - Boom[y+1][x] = Xblank; - Boom[y+1][x+1] = Xblank; + Next[x][y] = Zdynamite; + Boom[x-1][y-1] = Xblank; + Boom[x][y-1] = Xblank; + Boom[x+1][y-1] = Xblank; + Boom[x-1][y] = Xblank; + Boom[x][y] = Xblank; + Boom[x+1][y] = Xblank; + Boom[x-1][y+1] = Xblank; + Boom[x][y+1] = Xblank; + Boom[x+1][y+1] = Xblank; } static void Lwheel(int x, int y) { if (lev.wheel_cnt && x == lev.wheel_x && y == lev.wheel_y) - Cave[y][x] = XwheelB; + Cave[x][y] = XwheelB; } static void Lswitch(int x, int y) { if (lev.ball_state) - Cave[y][x] = XswitchB; + Cave[x][y] = XswitchB; } static void Lfake_amoeba(int x, int y) { if (lev.lenses_cnt) - Cave[y][x] = Xfake_amoebaB; + Cave[x][y] = Xfake_amoebaB; } static void Lfake_blank(int x, int y) { if (lev.lenses_cnt) - Cave[y][x] = Xfake_blankB; + Cave[x][y] = Xfake_blankB; } static void Lfake_grass(int x, int y) { if (lev.magnify_cnt) - Cave[y][x] = Xfake_grassB; + Cave[x][y] = Xfake_grassB; } static void Lfake_door_1(int x, int y) { if (lev.magnify_cnt) - Cave[y][x] = Xdoor_1; + Cave[x][y] = Xdoor_1; } static void Lfake_door_2(int x, int y) { if (lev.magnify_cnt) - Cave[y][x] = Xdoor_2; + Cave[x][y] = Xdoor_2; } static void Lfake_door_3(int x, int y) { if (lev.magnify_cnt) - Cave[y][x] = Xdoor_3; + Cave[x][y] = Xdoor_3; } static void Lfake_door_4(int x, int y) { if (lev.magnify_cnt) - Cave[y][x] = Xdoor_4; + Cave[x][y] = Xdoor_4; } static void Lfake_door_5(int x, int y) { if (lev.magnify_cnt) - Cave[y][x] = Xdoor_5; + Cave[x][y] = Xdoor_5; } static void Lfake_door_6(int x, int y) { if (lev.magnify_cnt) - Cave[y][x] = Xdoor_6; + Cave[x][y] = Xdoor_6; } static void Lfake_door_7(int x, int y) { if (lev.magnify_cnt) - Cave[y][x] = Xdoor_7; + Cave[x][y] = Xdoor_7; } static void Lfake_door_8(int x, int y) { if (lev.magnify_cnt) - Cave[y][x] = Xdoor_8; + Cave[x][y] = Xdoor_8; } static void Lboom_1(int x, int y) { - Next[y][x] = Xboom_2; + Next[x][y] = Xboom_2; #if !PLAY_ELEMENT_SOUND if (x != lev.exit_x && y != lev.exit_y) play_sound(x, y, SOUND_boom); @@ -4941,7 +4941,7 @@ static void Lboom_1(int x, int y) static void Lboom_2(int x, int y) { - Next[y][x] = Boom[y][x]; + Next[x][y] = Boom[x][y]; } static void Lboom_android(int x, int y) @@ -4955,17 +4955,17 @@ static void Lboom_android(int x, int y) void synchro_2(void) { - int x = 0; - int y = 1; - short *cave_cache = Cave[y]; /* might be a win */ + int x, y; int element; seed = RandomEM; score = 0; - loop: - - element = cave_cache[++x]; + for (y = 1; y < HEIGHT - 1; y++) + { + for (x = 0; x < WIDTH; x++) + { + element = Cave[x][y]; switch (element) { @@ -5133,23 +5133,14 @@ void synchro_2(void) case Xboom_android: Lboom_android(x, y); goto loop; case Xboom_1: Lboom_1(x, y); goto loop; case Xboom_2: Lboom_2(x, y); goto loop; + } - case Zborder: - if (++y < HEIGHT - 1) - { - x = 0; - cave_cache = Cave[y]; - goto loop; - } - - goto done; + loop: + ; - default: - goto loop; + } } - done: - if (ply[0].alive || ply[1].alive || ply[2].alive || ply[3].alive) lev.score += score; /* only add a score if someone is alive */ else diff --git a/src/game_em/synchro_3.c b/src/game_em/synchro_3.c index cdea7a21..8ec410d3 100644 --- a/src/game_em/synchro_3.c +++ b/src/game_em/synchro_3.c @@ -49,7 +49,7 @@ void synchro_3(void) { x = (random >> 10) % (WIDTH - 2); y = (random >> 20) % (HEIGHT - 2); - switch (Cave[y][x]) + switch (Cave[x][y]) { case Xblank: case Xacid_splash_e: @@ -59,11 +59,11 @@ void synchro_3(void) case Xsand: case Xplant: case Yplant: - if (tab_amoeba[Cave[y-1][x]] || - tab_amoeba[Cave[y][x+1]] || - tab_amoeba[Cave[y+1][x]] || - tab_amoeba[Cave[y][x-1]]) - Cave[y][x] = Xdrip; + if (tab_amoeba[Cave[x][y-1]] || + tab_amoeba[Cave[x+1][y]] || + tab_amoeba[Cave[x][y+1]] || + tab_amoeba[Cave[x-1][y]]) + Cave[x][y] = Xdrip; } random = random * 129 + 1; @@ -76,30 +76,30 @@ void synchro_3(void) for (y = 1; y < HEIGHT - 1; y++) for (x = 1; x < WIDTH - 1; x++) { - switch (Cave[y][x]) + switch (Cave[x][y]) { case Znormal: - Cave[y][x] = Xboom_1; - Cave[y-1][x] = tab_explode_normal[Cave[y-1][x]]; - Cave[y][x-1] = tab_explode_normal[Cave[y][x-1]]; - Cave[y][x+1] = tab_explode_normal[Cave[y][x+1]]; - Cave[y+1][x] = tab_explode_normal[Cave[y+1][x]]; - Cave[y-1][x-1] = tab_explode_normal[Cave[y-1][x-1]]; - Cave[y-1][x+1] = tab_explode_normal[Cave[y-1][x+1]]; - Cave[y+1][x-1] = tab_explode_normal[Cave[y+1][x-1]]; - Cave[y+1][x+1] = tab_explode_normal[Cave[y+1][x+1]]; + Cave[x][y] = Xboom_1; + Cave[x][y-1] = tab_explode_normal[Cave[x][y-1]]; + Cave[x-1][y] = tab_explode_normal[Cave[x-1][y]]; + Cave[x+1][y] = tab_explode_normal[Cave[x+1][y]]; + Cave[x][y+1] = tab_explode_normal[Cave[x][y+1]]; + Cave[x-1][y-1] = tab_explode_normal[Cave[x-1][y-1]]; + Cave[x+1][y-1] = tab_explode_normal[Cave[x+1][y-1]]; + Cave[x-1][y+1] = tab_explode_normal[Cave[x-1][y+1]]; + Cave[x+1][y+1] = tab_explode_normal[Cave[x+1][y+1]]; break; case Zdynamite: - Cave[y][x] = Xboom_1; - Cave[y-1][x] = tab_explode_dynamite[Cave[y-1][x]]; - Cave[y][x-1] = tab_explode_dynamite[Cave[y][x-1]]; - Cave[y][x+1] = tab_explode_dynamite[Cave[y][x+1]]; - Cave[y+1][x] = tab_explode_dynamite[Cave[y+1][x]]; - Cave[y-1][x-1] = tab_explode_dynamite[Cave[y-1][x-1]]; - Cave[y-1][x+1] = tab_explode_dynamite[Cave[y-1][x+1]]; - Cave[y+1][x-1] = tab_explode_dynamite[Cave[y+1][x-1]]; - Cave[y+1][x+1] = tab_explode_dynamite[Cave[y+1][x+1]]; + Cave[x][y] = Xboom_1; + Cave[x][y-1] = tab_explode_dynamite[Cave[x][y-1]]; + Cave[x-1][y] = tab_explode_dynamite[Cave[x-1][y]]; + Cave[x+1][y] = tab_explode_dynamite[Cave[x+1][y]]; + Cave[x][y+1] = tab_explode_dynamite[Cave[x][y+1]]; + Cave[x-1][y-1] = tab_explode_dynamite[Cave[x-1][y-1]]; + Cave[x+1][y-1] = tab_explode_dynamite[Cave[x+1][y-1]]; + Cave[x-1][y+1] = tab_explode_dynamite[Cave[x-1][y+1]]; + Cave[x+1][y+1] = tab_explode_dynamite[Cave[x+1][y+1]]; break; } } @@ -108,5 +108,5 @@ void synchro_3(void) for (y = 0; y < HEIGHT; y++) for (x = 0; x < WIDTH; x++) - Next[y][x] = Cave[y][x]; + Next[x][y] = Cave[x][y]; }