6 pr_1
:array [0..7] of image
;
8 pr_2
:array [0..7] of image
;
10 pr_3
:array [0..7] of image
;
12 pr_4
:array [0..7] of image
;
14 pr_5
:array [0..7] of image
;
16 pr_boom
:array [0..15] of image
;
19 max_particles
:integer;
23 procedure create_particle(tp
,ix
,iy
:integer);
24 procedure update_particle
;
25 procedure draw_particle
;
28 uses vars
,maps
,particles_store
;
30 procedure create_particle(tp
,ix
,iy
:integer);
34 if s_particles
=true then
35 for i
:=0 to max_particles
do
36 if get_particle_type(i
)=0 then
38 set_particle(i
,tp
,0,ix
,iy
);
43 procedure null_particle(i
:integer);
45 set_particle(i
,0,0,0,0);
48 procedure pr_ai_1(i
,maxani
:integer);
50 set_particle_y(i
,get_particle_y(i
)-1);
51 set_particle_ani(i
,get_particle_ani(i
)+1);
52 if get_particle_ani(i
)>maxani
then null_particle(i
);
55 procedure pr_ai_bubble(i
:integer);
59 set_particle_y(i
,get_particle_y(i
)-1);
60 xx
:=get_particle_x(i
) div 16;
61 yy
:=get_particle_y(i
) div 16;
62 if getmap(xx
,yy
)<>50 then null_particle(i
);
65 procedure pr_ai_boom(i
:integer);
67 set_particle_ani(i
,get_particle_ani(i
)+1);
68 if get_particle_ani(i
)>15 then null_particle(i
);
71 procedure update_particle
;
75 if s_particles
=true then
77 for i
:=0 to max_particles
do
78 if get_particle_type(i
)>0 then
80 if get_particle_type(i
)=1 then pr_ai_1(i
,5); else
81 if get_particle_type(i
)=2 then pr_ai_1(i
,5); else
82 if get_particle_type(i
)=3 then pr_ai_1(i
,5); else
83 if get_particle_type(i
)=4 then pr_ai_1(i
,5); else
84 if get_particle_type(i
)=5 then pr_ai_1(i
,5); else
85 if get_particle_type(i
)=6 then pr_ai_bubble(i
); else
86 if get_particle_type(i
)=7 then pr_ai_boom(i
); else
90 if gb_up_pa
>=2 then gb_up_pa
:=0;
94 procedure draw_particle
;
98 for i
:=0 to max_particles
do
99 if get_particle_type(i
)>0 then
101 if get_particle_type(i
)=1 then
103 if (get_particle_x(i
)-camx
>-8) and (get_particle_x(i
)-camx
<getwidth
) and (get_particle_y(i
)-camy
>-8) and (get_particle_y(i
)-camy
<getheight
) then
104 drawimage(pr_1
[get_particle_ani(i
)],get_particle_x(i
)-camx
,get_particle_y(i
)-camy
);
106 if get_particle_type(i
)=2 then
108 if (get_particle_x(i
)-camx
>-8) and (get_particle_x(i
)-camx
<getwidth
) and (get_particle_y(i
)-camy
>-8) and (get_particle_y(i
)-camy
<getheight
) then
109 drawimage(pr_2
[get_particle_ani(i
)],get_particle_x(i
)-camx
,get_particle_y(i
)-camy
);
111 if get_particle_type(i
)=3 then
113 if (get_particle_x(i
)-camx
>-8) and (get_particle_x(i
)-camx
<getwidth
) and (get_particle_y(i
)-camy
>-8) and (get_particle_y(i
)-camy
<getheight
) then
114 drawimage(pr_3
[get_particle_ani(i
)],get_particle_x(i
)-camx
,get_particle_y(i
)-camy
);
116 if get_particle_type(i
)=4 then
118 if (get_particle_x(i
)-camx
>-8) and (get_particle_x(i
)-camx
<getwidth
) and (get_particle_y(i
)-camy
>-8) and (get_particle_y(i
)-camy
<getheight
) then
119 drawimage(pr_4
[get_particle_ani(i
)],get_particle_x(i
)-camx
,get_particle_y(i
)-camy
);
121 if get_particle_type(i
)=5 then
123 if (get_particle_x(i
)-camx
>-8) and (get_particle_x(i
)-camx
<getwidth
) and (get_particle_y(i
)-camy
>-8) and (get_particle_y(i
)-camy
<getheight
) then
124 drawimage(pr_4
[get_particle_ani(i
)],get_particle_x(i
)-camx
,get_particle_y(i
)-camy
);
126 if get_particle_type(i
)=6 then
128 if (get_particle_x(i
)-camx
>-8) and (get_particle_x(i
)-camx
<getwidth
) and (get_particle_y(i
)-camy
>-8) and (get_particle_y(i
)-camy
<getheight
) then
129 drawimage(bubble
,get_particle_x(i
)-camx
,get_particle_y(i
)-camy
);
131 if get_particle_type(i
)=7 then
133 if (get_particle_x(i
)-camx
>-32) and (get_particle_x(i
)-camx
<getwidth
) and (get_particle_y(i
)-camy
>-32) and (get_particle_y(i
)-camy
<getheight
) then
134 drawimage(pr_boom
[get_particle_ani(i
)],get_particle_x(i
)-camx
,get_particle_y(i
)-camy
);