-
Notifications
You must be signed in to change notification settings - Fork 0
/
shadow_bonus.c
71 lines (64 loc) · 1.66 KB
/
shadow_bonus.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* shadow_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hgrissen <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/02/12 10:58:44 by hgrissen #+# #+# */
/* Updated: 2021/02/18 11:37:52 by hgrissen ### ########.fr */
/* */
/* ************************************************************************** */
#include "header_bonus.h"
void red_post(void)
{
int i;
int j;
if (g_post)
{
i = 0;
while (i < g_prm.h)
{
j = 0;
while (j < g_prm.w)
{
my_mlx_pixel_put(&g_img, j, i, 0x50FF0000);
j++;
}
i++;
}
}
g_post = 0;
}
void health_bar(void)
{
int i;
int j;
i = g_prm.h - (g_prm.h / 20) + 2;
while (i < g_prm.h - (g_prm.h / 20) + (g_prm.h / 30) - 2)
{
j = (g_prm.w / 4) + 2;
while (j < (g_prm.w / 4) + 2 + (g_healthmax - g_dmg))
{
my_mlx_pixel_put(&g_img, j, i, 0x00FF0000);
j++;
}
i++;
}
}
void health_bg(void)
{
int i;
int j;
i = g_prm.h - (g_prm.h / 20);
while (i < (g_prm.h - (g_prm.h / 20)) + (g_prm.h / 30))
{
j = (g_prm.w / 4);
while (j < g_prm.w - (g_prm.w / 4))
{
my_mlx_pixel_put(&g_img, j, i, 0x000000);
j++;
}
i++;
}
}