diff --git a/ASTEROID.PAS b/ASTEROID.PAS index 97e1d3e..cb59152 100755 --- a/ASTEROID.PAS +++ b/ASTEROID.PAS @@ -9,6 +9,7 @@ const max_ornis=15; velocitat=2; velocitat_max=6; + max_bales=3; type ipunt=RECORD r,angle:real; END; punt=RECORD x,y:integer; END; @@ -25,6 +26,7 @@ type velocitat:real; n:byte; drotacio,rotacio:real; + esta:boolean; END; @@ -39,6 +41,7 @@ var nau:triangle;pol:poligon; puntaux:punt; orni:array [1..max_ornis] of poligon; virt:^pvirt; + bales:array [1..max_bales] of poligon; procedure volca; var i:word; @@ -289,6 +292,21 @@ begin orni.rotacio:=orni.rotacio+orni.drotacio; end; +procedure mou_bales(var orni:poligon); +var dx,dy:real; +begin + orni.angle:=orni.angle{+(random(256)/512)*(random(3)-1)}; + Dy:=round(orni.velocitat*sin(orni.angle-pi/2))+orni.centre.y; + Dx:=round(orni.velocitat*cos(orni.angle-pi/2))+orni.centre.x; + if (dy>marge_dalt) and (dymarge_esq) and (dxmarge_dalt) and (dy