-
Notifications
You must be signed in to change notification settings - Fork 0
/
barre_de_vie.c
78 lines (71 loc) · 1.88 KB
/
barre_de_vie.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* minimap.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rcheiko <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/04/01 11:58:07 by rcheiko #+# #+# */
/* Updated: 2021/04/22 11:47:02 by rcheiko ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
void barre_de_vie(t_mlx *d)
{
int haut;
int haut_b;
int larg_b;
haut = d->largeur - 15;
haut_b = haut / 1.02;
larg_b = d->longueur * 0.1;
while (haut > haut_b)
{
my_mlx_pixel_put(d, 15, haut, 0x000000);
haut--;
}
while (15 < larg_b)
{
my_mlx_pixel_put(d, larg_b, haut, 0x000000);
larg_b--;
}
}
void barre_de_vie_2(t_mlx *d)
{
int haut;
int haut_b;
int larg_b;
larg_b = d->longueur * 0.1;
haut = d->largeur - 15;
haut_b = haut / 1.02;
while (haut >= haut_b)
{
my_mlx_pixel_put(d, larg_b, haut, 0x000000);
haut--;
}
while (larg_b > 15)
{
my_mlx_pixel_put(d, larg_b, (int)d->largeur - 15, 0x000000);
larg_b--;
}
}
void barre_de_vie_3(t_mlx *d)
{
int haut;
int haut_b;
int larg_b;
barre_de_vie(d);
barre_de_vie_2(d);
haut = d->largeur - 16;
haut_b = haut / 1.02;
larg_b = (d->longueur - 1) * 0.10;
while (15 < larg_b)
{
haut = d->largeur - 16;
while (haut > haut_b + 1)
{
my_mlx_pixel_put(d, larg_b, haut, 0xFF0000);
haut--;
}
larg_b--;
}
}