-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlevel_setup.c
45 lines (40 loc) · 1.51 KB
/
level_setup.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* level_setup.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ahamdaou <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/01/21 10:41:34 by ahamdaou #+# #+# */
/* Updated: 2021/01/23 09:02:05 by ahamdaou ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
void bonus_init(void)
{
play_audio(1);
g_pref.is_collision_enabled = TRUE;
}
static void run_bonus(void)
{
bonus_init();
render();
mlx_loop_hook(vars()->mlx, input_handler, NULL);
mlx_loop(vars()->mlx);
}
void multiple_level_setup(int total_maps, char **path_value)
{
int map_index;
g_lvls = (t_map**)xmalloc(sizeof(t_map*) * total_maps);
g_lvlinfo.max_level = total_maps;
g_lvlinfo.current_level = 1;
map_index = -1;
while (++map_index < total_maps)
g_lvls[map_index] = load_map(path_value[map_index], MAX_INFO_BONUS);
g_game = *g_lvls[0];
vars();
rays_init();
player_init();
texture_init();
run_bonus();
}