Citation :
PROCESS jack(x,y)
private
incx=0;
dernier_y=0;
derniere_vit=0;
BEGIN
GRAPH=2; size=120; priority=1;
loop
if(TIMER[2]>700 AND destruction==TRUE)
stop_sound(c_alarme);
destruction=false;
reprise=true;
compte_ballon=0;
end
if(destruction)
col_robot=collision(type robot);
if(col_robot)
signal (col_robot,s_kill);
point+=50;
robots--;
end
end
col_bombe=collision(type bombe);
col_bonus=collision(type bonus);
col_vie=collision(type bonus_vie);
col_ballon=collision(type ballon);
IF(col_ballon and mort==FALSE)
stop_sound(c_ballon);
signal (col_ballon, s_kill);
reprise=false;
destruction=true;
TIMER[2]=0;
end
if(col_vie and mort==FALSE)
compte_bonus=0;
point+=10;
vie++;
signal(col_vie,s_kill);
sound(s_vie,256,256);
end
if(col_bombe and mort==FALSE)
if(col_bombe.graph==8)
point+=5;
end
if(col_bombe.graph==9 or col_bombe.graph==10)
if(bonus_fois>1)
texte_bonus(col_bombe.x,col_bombe.y);
end
point+=15*bonus_fois;
r_b_a++;
end
sound(s_bombe,256,256);
signal(col_bombe,s_kill);
compteur_bombe--;
if(compteur_bombe==0)
level++;
signal(type bombe, s_kill);
signal(type robot, s_kill);
signal(type bonus,s_kill);
signal(type bonus_vie,s_kill);
signal(type ballon,s_kill);
signal(type texte_bonus,s_kill);
fade(0,0,0,2);
while(fading);
frame;
end
fin_niveau();
end
end
if(col_bonus and mort==FALSE)
point+=5;
compte_bonus=0;
bonus_fois++;
sound(s_bonus,256,256);
signal(col_bonus,s_kill);
end
IF ((key(_right) OR joy.right) AND vitesse<6)
graph++;
if(graph>7)
graph=2;
end
vitesse+=1;
flags=1;
ELSE
IF ((key(_left) OR joy.left) AND vitesse>-6)
graph++;
if(graph>7)
graph=2;
end
vitesse-=2;
flags=0;
ELSE
IF (vitesse>0)
vitesse--;
END
IF (vitesse<0)
vitesse++;
END
END
END
derniere_vit=vitesse;
IF (derniere_vit<>0)
incx=derniere_vit/abs(derniere_vit);
WHILE (derniere_vit<>0)
IF (map_get_pixel(0,899+LEVEL,(x+incx),(y-2))<>15)
IF (map_get_pixel(0,899+LEVEL,(x+incx),(y-32))<>15)
x+=incx;
END
END
derniere_vit-=incx;
END
END
IF (key(_control) or joy.button1 and au_sol)
sound(s_saute,56,200);
vitesse_gravite=-force_saut;
END
gravite(18,18);
frame;
end
END
PROCESS bombe(x,y,num);
BEGIN
graph=9;size=120;
LOOP
bombe_allume=max(id.num,compteur_bombe);
if(id.num==bombe_allume)
graph++;
if(graph>10)
graph=9;
end
else
GRAPH=8;
end
frame;
end
END
PROCESS robot(x,y,x1,x2,forme);
PRIVATE
col_jack=0;
direction=-1;
debut;
fin;
ancien_forme;
incr_y;
BEGIN
robots++;
TIMER[1]=0;
TIMER[3]=0;
LOOP
if(reprise and id.forme==3)
stop_sound(c_alarme);
id.forme=ancien_forme;
TIMER[3]=400;
end
If(destruction and id.forme<>3)
ancien_forme=id.forme;
id.forme=3;
end
if(robots<4 and timer[3]>700 and not(destruction))
if(rand(0,2)<1)
robot(110,50,80,150,1);
else
id_robot=robot(350,50,310,380,1);
end
timer[3]=0;
end
if(id.forme==1)
FROM graph = 11 to 14;
col_jack=collision (TYPE jack);
IF (col_jack and mort==FALSE)
sound(s_mort,256,256);
mort=true;
REPEAT
col_jack.y+=incr_y;
incr_y++;
col_jack.angle+=pi/16;
col_jack.size+=14;
FRAME;
UNTIL (out_region(col_jack,0));
signal (col_jack,s_kill);
vie--;
bonus_fois=1;
compte_bonus=0;
robots=0;
control();
END
IF (au_sol)
IF (direction==-1 ) x+=2; flags=1; IF (x>x2) direction=1; END
ELSE x-=2; flags=0; IF (x<x1) direction=-1; END
END
IF(TIMER[1]>=300)
x2+=50;
END
if(y>410)
sound(s_trans,256,256);
from graph=56 to 61;
FRAME;
end
id.forme=2;
TIMER[1]=0;
end
END
gravite_robot(15,14);
FRAME;
end
end
IF(id.forme==2)
debut=15;
fin=22;
for(graph=debut; graph<=fin; graph++)
col_jack=collision (TYPE jack);
IF (col_jack AND mort==FALSE)
sound(s_mort,256,256);
mort=true;
REPEAT
col_jack.y+=incr_y;
incr_y++;
col_jack.angle+=pi/16;
col_jack.size+=14;
FRAME;
UNTIL (out_region(col_jack,0));
signal (col_jack,s_kill);
vie--;
bonus_fois=1;
compte_bonus=0;
robots=0;
control();
END
IF (x>id_jack.x)
flags=0;
if(map_get_pixel(0,899+level,x+16,y)==20 or map_get_pixel(0,899+level,x-16,y)==20)
y+=3;
else
if(map_get_pixel(0,899+level,x+16,y)==15 or map_get_pixel(0,899+level,x-16,y)==15)
y-=3;
else
x-=1;
end
end
else
flags=1;
if(map_get_pixel(0,899+level,x+16,y)==20 or map_get_pixel(0,899+level,x-16,y)==20)
y+=3;
else
if(map_get_pixel(0,899+level,x+16,y)==15 or map_get_pixel(0,899+level,x-16,y)==15)
y-=3;
else
x+=1;
end
end
end
IF (y<id_jack.y)
if(map_get_pixel(0,899+level,x,y+16)<>61)
y++;
else
flags=1;
x+=2;
end
else
if(map_get_pixel(0,899+level,x,y-19)<>115)
y--;
else
flags=0;
x-=2;
end
end
frame;
END
END
if(id.forme==3)
if(TIMER[2]>700)
stop_sound(c_alarme);
end
graph=40;
if(TIMER[2]>400)
c_alarme=sound(s_alarme,256,256);
loop
if(reprise)
break;
end
GRAPH++;
if(graph>=48)
graph=40;
end
FRAME;
end
end
frame;
END
END
END
|