home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / grafik / sprite / demo7.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-07-18  |  3.3 KB  |  79 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.       (*                                                              *)
  11.       (*                         DEMO7.PAS                            *)
  12.       (*                                                              *)
  13.       (*   This program provides an example of "zone-clearing." The   *)
  14.       (*   The sprite is designed with trailing blanks which erase    *)
  15.       (*   the previous image at the same time the new sprite is      *)
  16.       (*   being placed on the screen at an advanced position. With   *)
  17.       (*   this method neither Xor nor page-flipping is required for  *)
  18.       (*   animation. Since it is simple it is also quite fast.       *)
  19.       (*                                                              *)
  20.       (*   Notice how increasing delays affect the result. You might  *)
  21.       (*   also see how increases or decreases in the size of the     *)
  22.       (*   zone of trailing blanks affect the resultant animation.    *)
  23.       (*   Take a look at the sprite (zone.spr) using the sprite      *)
  24.       (*   editor (Designer.com).                                     *)
  25.       (*                                                              *)
  26.       (*                              (c) Donald L. Pavia             *)
  27.       (*          Ver 1.0             Department of Chemistry         *)
  28.       (*       February 1986          Western Washington University   *)
  29.       (*                              Bellingham, Washington 98225    *)
  30.       (*                                                              *)
  31.       (* ************************************************************ *)
  32.  
  33.  
  34. program SpriteDemo7;
  35.                                   { Try changing j to 25 and k to 12 from }
  36.  
  37. uses
  38.   Crt,
  39.   turbo3,
  40.   Graph3;
  41.  
  42. const  j = 75; k = 4;             { 75 and 4, respectively. Then change   }
  43.                                   { zone1.spr to zone2.spr                }
  44. var    i : integer;
  45.  
  46. {----------------------------------------------------------------------------}
  47. {$I Sprites.Lib}
  48. {----------------------------------------------------------------------------}
  49.  
  50. BEGIN
  51.      clrscr;
  52.      GraphColorMode; GraphBackGround (1); Palette (2);
  53.  
  54.      LoadSprite ('Zone1.spr');        { loads sprite into var TempSprite   }
  55.  
  56.      gotoxy (2,1); write ('Press <ENTER> ');
  57.      read (Kbd,Wait);
  58. {! 4. Kbd e^rfordert das Unit Turbo3 - verwenden Sie ReadKey (im Unit Crt)}
  59.      gotoxy (2,1); write ('              ');
  60.  
  61.      Sprite := TempSprite;           { assign TempSprite as active sprite }
  62.  
  63.      for i := 1 to j do begin
  64.           PutSpriteC (k*i,50);  Delay (0);   end;
  65.      for i := 1 to j do begin
  66.           PutSpriteC (k*i,75);  Delay (25);  end;
  67.      for i := 1 to j do begin
  68.           PutSpriteC (k*i,100); Delay (50);  end;
  69.      for i := 1 to j do begin
  70.           PutSpriteC (k*i,125); Delay (100); end;
  71.      for i := 1 to j do begin
  72.           PutSpriteC (k*i,150); Delay (150); end;
  73.  
  74.      read (Kbd,Wait);
  75. {! 5. Kbd e^rfordert das Unit Turbo3 - verwenden Sie ReadKey (im Unit Crt)}
  76.      TextMode (c80);
  77.  
  78. END.
  79.