I made this simple star routine.
The stars are stored in a List (L0), but is there any other way?
EXPORT Stars()
BEGIN
LOCAL XX,YY,ANG,VEL;
DIMGROB_P(G1,320,240);
L0:={};
REPEAT
XX:=RANDOM(1,319);
YY:=RANDOM(1,239);
FOR I FROM 1 TO 400 STEP 4 DO
L0(I):=XX;
L0(I+1):=YY;
VEL:=RANDOM(0.5,5.0);
ANG:=π*RANDOM(0.0,2.0);
L0(I+2):=VEL*COS(ANG);
L0(I+3):=VEL*SIN(ANG);
END;
RECT_P(G1,#000000);
FOR J FROM 1 TO 50 DO
// RECT_P(G1,#000000);
FOR I FROM 1 TO 400 STEP 4 DO
PIXON_P(G1,L0(I),L0(I+1),#FFFFFF);
PIXON_P(G1,L0(I)+1,L0(I+1),#FFFFFF);
PIXON_P(G1,L0(I),L0(I+1)+1,#FFFFFF);
PIXON_P(G1,L0(I)+1,L0(I+1)+1,#FFFFFF);
END;
BLIT_P(G0,G1);
FOR I FROM 1 TO 400 STEP 4 DO
L0(I):=L0(I)+L0(I+2);
L0(I+1):=L0(I+1)+L0(I+3);
L0(I+3):=L0(I+3)+0.15;
END;
END;
UNTIL ISKEYDOWN(14);
END;