home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / grafik / sprite / demo5.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-07-18  |  2.4 KB  |  78 lines

  1. {$R-}    {Bereichsprüfung aus}
  2. {$B+}    {vollständige Auswertung boolscher Ausdrücke}
  3. {$S+}    {Stackprüfung an}
  4. {$I+}    {I/O-Prüfung an}
  5. {$N-}    {kein numerischer Coprozessor}
  6. {$M 65500,16384,655360} {3.0-Standardvorgaben für Stack&Heap}
  7.  
  8.       (* ********************************************************* *)
  9.       (*                                                           *)
  10.       (*  This program presents a simple example of XOR animation. *)
  11.       (*  None of the multipage techniques are used here.          *)
  12.       (*                                                           *)
  13.       (*                          (c) Donald L. Pavia              *)
  14.       (*        Ver 1.0           Department of Chemistry          *)
  15.       (*     February 1986        Western Washington University    *)
  16.       (*                          Bellingham, Washington 98225     *)
  17.       (*                                                           *)
  18.       (* ********************************************************* *)
  19.  
  20. program Demo5;
  21.  
  22.  
  23. uses
  24.   Crt,
  25.   turbo3,
  26.   Graph3;
  27.  
  28. var   start,finish,counter,step,hold,i,position : integer;
  29.  
  30. {----------------------------------------------------------------------------}
  31. {$I Sprites.Lib}
  32. {----------------------------------------------------------------------------}
  33.  
  34. BEGIN
  35.  
  36.      LoadTable ('Demo5.Tab');
  37.  
  38.   REPEAT
  39.      clrscr;
  40.      GraphColorMode; GraphBackGround (1); Palette (2);
  41.  
  42.      start := 1; finish := 12; step := 0; counter := 0;
  43.      position := 150; hold := 125;
  44.  
  45.      TextColor (1);
  46.      gotoxy (10,4); write ('XOR ANIMATION');
  47.  
  48.      REPEAT
  49.        for i := start to finish do
  50.             begin
  51.                  Sprite := Table[i];  XorSpriteC (position,100);
  52.  
  53.                  Sprite := Table[i+12]; XorSpriteC (position+12,120);
  54.  
  55.                  Delay (Hold);
  56.  
  57.                  Sprite := Table[i];  XorSpriteC (position,100);
  58.  
  59.                  Sprite := Table[i+12]; XorSpriteC (position+12,120);
  60.  
  61.                  position := position + Step; counter := counter + 1;
  62.             end;
  63.             Delay (1750);
  64.  
  65.      UNTIL (position >= 300) or (counter >= 40);
  66.  
  67.      gotoxy (5,23); write ('Repeat Again? Y/N ?  ');
  68.      repeat
  69.             read (Kbd,Wait);
  70. {! 4. Kbd erforder^t das Unit Turbo3 - verwenden Sie ReadKey (im Unit Crt)}
  71.      until UpCase(Wait) in ['Y','N'];
  72.  
  73.   UNTIL UpCase(Wait) = 'N';
  74.  
  75.      TextMode (c80);
  76.  
  77. END.
  78.