-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlaser.c
33 lines (28 loc) · 860 Bytes
/
laser.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
/*****************************************
Mroczna Harmonia
laser.c xxxxxxxxxxxx
(C) 2001, 2023 M. Feliks
*****************************************/
#include "globals.h"
void laser(int x, int y, KAPSULA* kaps, POLE* ple, int laser_pom)
{
while (y < 199 - 8) {
if (laser_pom) {
draw_sprite(spr_pocisk[BUZZ], x, y, 8, 8, bufor);
laser_pom = 0;
} else {
draw_sprite(spr_pocisk[BUZZ + 1], x, y, 8, 8, bufor);
laser_pom = 1;
}
y += 8;
}
if (x >= kaps->x && x <= kaps->x + 20 && kaps->aktywna && !kaps->trafiona && !ple->aktywne) {
kaps->giwera--;
kaps->trafiona = 1;
if (kaps->giwera < 0) {
kaps->aktywna = 0;
kaps->klatka = 42;
} else
w_inicjuj(kaps->x + 10, kaps->y + 10, 12, 44);
}
}