home *** CD-ROM | disk | FTP | other *** search
/ Mega CD-ROM 1 / megacd_rom_1.zip / megacd_rom_1 / MAGAZINE / INSIDE_T / ITPAUG90.ZIP / TEST2.PAS < prev   
Pascal/Delphi Source File  |  1990-06-20  |  938b  |  42 lines

  1. {*************************************************
  2. * TEST2.PAS - Draw stars on coordinate system of *
  3. * x ε (0,1.0) and y ε (0,1.0)                    *
  4. *************************************************}
  5.  
  6. PROCEDURE DrawPict;
  7.  
  8. VAR
  9.   CtrX, CtrY, MaxX, MaxY, Tx, Ty : Integer;
  10.   L : Real;
  11.   Ctr : Integer;
  12.  
  13. BEGIN
  14.  
  15.   {* Initialize scaling factors *}
  16.  
  17.   MaxX := GetMaxX;
  18.   MaxY := GetMaxY;
  19.  
  20.   {* Compute screen center coordinate *}
  21.  
  22.   CtrX := MaxX DIV 2;
  23.   CtrY := MaxY DIV 2;
  24.  
  25.   {* Draw the expanding & contracting star *}
  26.  
  27.   FOR Ctr := 1 TO 19 DO BEGIN
  28.     Tx := (MaxX * Ctr) DIV 100;
  29.     Ty := (MaxY * Ctr) DIV 100;
  30.     DrawStar(CtrX,CtrY,Tx,Ty,1);
  31.     Delay(15);
  32.     DrawStar(CtrX,CtrY,Tx,Ty,0);
  33.     END;
  34.   FOR Ctr := 20 DOWNTO 1 DO BEGIN
  35.     Tx := (MaxX * Ctr) DIV 100;
  36.     Ty := (MaxY * Ctr) DIV 100;
  37.     DrawStar(CtrX,CtrY,Tx,Ty,1);
  38.     Delay(15);
  39.     DrawStar(CtrX,CtrY,Tx,Ty,0);
  40.     END
  41. END;
  42.