-
Notifications
You must be signed in to change notification settings - Fork 0
/
window2.c
38 lines (34 loc) · 860 Bytes
/
window2.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
/*
** EPITECH PROJECT, 2022
** window2.c
** File description:
** window2
*/
#include "my_runner.h"
void update_all
(player_t *player, game_object_t **obj, game_bg_t **bg, sfClock *clock)
{
update_enemy(obj, clock);
move_tile(obj);
update_player(player, obj, clock);
update_all_bg(bg, clock);
}
sfMusic *create_music_game(void)
{
sfMusic *music = sfMusic_createFromFile("sounds/music/bg_game.ogg");
sfMusic_setLoop(music, sfTrue);
sfMusic_setVolume(music, 30);
sfMusic_play(music);
return music;
}
all_game_obj_t *create_all_obj(char *file)
{
all_game_obj_t *all = malloc(sizeof(all_game_obj_t));
all->file = file;
all->obj = create_tile_map(file);
all->player = create_player();
all->bg = create_all_layer();
all->music = create_music_game();
all->clock = sfClock_create();
return all;
}