//-----------------------------------------------
//Program: R-Type
//Author: EclypsE
//Team:
//-----------------------------------------------
Program Tutorial;
Global
Int musica;
Begin
set_title("Tutorial de Fenix");
set_mode (m320x240);
Graph_mode=MODE_8BITS;
load_fpg("img\sprite.fpg");
put_screen(0,4);
musica=load_song("img\musica.it");
write_int(0, 160, 140, 4, OFFSET musica);
play_song(musica,0);
Nave();
Enemigo();
Loop
Frame;
If(key(_enter)) Break; End;
End;
let_me_alone();
End
Process nave()
Private
Int id_col;Int vidas;
Begin
graph=1;
x=100; y=100;
vidas=3;
write(0, 35, 10, 4, "Nº Vidas =");
write_int(0, 75, 10, 4, OFFSET vidas);
//id_nave=nave();
Loop
Frame;
If(key(_left) && x>16) x-=3; End
If(key(_right) && x<304) x+=3; End
If(key(_up) && y>8) y-=3; End
If(key(_down) && y<232) y+=3; End
If(key(_control)) Disparo(x,y); End
id_col=collision(Type Enemigo);
If (id_col!=0)
vidas-=1;
If (vidas==0) exit("",0); End
x=32;
y=rand(0,240);
End
End
End
Process Disparo(Int xnave,Int ynave)
Private
Int id_col;
Begin
graph=2;
x=xnave+24;y=ynave;
Repeat
Frame;
x+=8;
id_col=collision(Type Enemigo);
If (id_col!=0)
id_col.x=320;
id_col.y=rand(0,240);
End
Until(x>318)
End
Process Enemigo()
Begin
graph=3;
x=320;
y=230;
Loop
If (x==0)
x=320;
y=rand(0,240);
End
Frame;
x-=2;
End
End
Marcadores