1 /* third part of synchro.
3 * handle global elements.
5 * this should be spread over the frames for reduced cpu load.
18 /* update variables */
25 if (lev.time_initial == 0)
27 else if (lev.time > 0)
35 if (lev.android_move_cnt-- == 0)
36 lev.android_move_cnt = lev.android_move_time;
37 if (lev.android_clone_cnt-- == 0)
38 lev.android_clone_cnt = lev.android_clone_time;
40 if (lev.ball_cnt-- == 0)
41 lev.ball_cnt = lev.ball_time;
50 if (lev.wonderwall_time && lev.wonderwall_state)
51 lev.wonderwall_time--;
54 if (lev.time_initial > 0 &&
55 lev.time > 0 && lev.time <= 50 && lev.time % 5 == 0 && setup.time_limit)
56 play_sound(-1, -1, SAMPLE_time);
60 play_element_sound(lev.wheel_x, lev.wheel_y, SAMPLE_wheel, Xwheel);
66 for (count = lev.amoeba_time; count--;)
68 x = (random >> 10) % (WIDTH - 2);
69 y = (random >> 20) % (HEIGHT - 2);
80 if (tab_amoeba[Cave[y-1][x]] ||
81 tab_amoeba[Cave[y][x+1]] ||
82 tab_amoeba[Cave[y+1][x]] ||
83 tab_amoeba[Cave[y][x-1]])
84 Cave[y][x] = Xdrip_eat;
87 random = random * 129 + 1;
92 /* handle explosions */
94 for (y = 1; y < HEIGHT - 1; y++)
95 for (x = 1; x < WIDTH - 1; x++)
100 Cave[y][x] = Xboom_1;
101 Cave[y-1][x] = tab_explode_normal[Cave[y-1][x]];
102 Cave[y][x-1] = tab_explode_normal[Cave[y][x-1]];
103 Cave[y][x+1] = tab_explode_normal[Cave[y][x+1]];
104 Cave[y+1][x] = tab_explode_normal[Cave[y+1][x]];
105 Cave[y-1][x-1] = tab_explode_normal[Cave[y-1][x-1]];
106 Cave[y-1][x+1] = tab_explode_normal[Cave[y-1][x+1]];
107 Cave[y+1][x-1] = tab_explode_normal[Cave[y+1][x-1]];
108 Cave[y+1][x+1] = tab_explode_normal[Cave[y+1][x+1]];
112 Cave[y][x] = Xboom_1;
113 Cave[y-1][x] = tab_explode_dynamite[Cave[y-1][x]];
114 Cave[y][x-1] = tab_explode_dynamite[Cave[y][x-1]];
115 Cave[y][x+1] = tab_explode_dynamite[Cave[y][x+1]];
116 Cave[y+1][x] = tab_explode_dynamite[Cave[y+1][x]];
117 Cave[y-1][x-1] = tab_explode_dynamite[Cave[y-1][x-1]];
118 Cave[y-1][x+1] = tab_explode_dynamite[Cave[y-1][x+1]];
119 Cave[y+1][x-1] = tab_explode_dynamite[Cave[y+1][x-1]];
120 Cave[y+1][x+1] = tab_explode_dynamite[Cave[y+1][x+1]];
125 /* triple buffering */
127 for (y = 0; y < HEIGHT; y++)
128 for (x = 0; x < WIDTH; x++)
129 Next[y][x] = Cave[y][x];