home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / USCX / TPSPRITE.ZIP / DEMO7.PAS < prev    next >
Pascal/Delphi Source File  |  1986-02-15  |  3KB  |  64 lines

  1.  
  2.       (* ************************************************************ *)
  3.       (*                                                              *)
  4.       (*                         DEMO7.PAS                            *)
  5.       (*                                                              *)
  6.       (*   This program provides an example of "zone-clearing." The   *)
  7.       (*   The sprite is designed with trailing blanks which erase    *)
  8.       (*   the previous image at the same time the new sprite is      *)
  9.       (*   being placed on the screen at an advanced position. With   *)
  10.       (*   this method neither Xor nor page-flipping is required for  *)
  11.       (*   animation. Since it is simple it is also quite fast.       *)
  12.       (*                                                              *)
  13.       (*   Notice how increasing delays affect the result. You might  *)
  14.       (*   also see how increases or decreases in the size of the     *)
  15.       (*   zone of trailing blanks affect the resultant animation.    *)
  16.       (*   Take a look at the sprite (zone.spr) using the sprite      *)
  17.       (*   editor (Designer.com).                                     *)
  18.       (*                                                              *)
  19.       (*                              (c) Donald L. Pavia             *)
  20.       (*          Ver 1.0             Department of Chemistry         *)
  21.       (*       February 1986          Western Washington University   *)
  22.       (*                              Bellingham, Washington 98225    *)
  23.       (*                                                              *)
  24.       (* ************************************************************ *)
  25.  
  26.  
  27. program SpriteDemo7;
  28.                                   { Try changing j to 25 and k to 12 from }
  29. const  j = 75; k = 4;             { 75 and 4, respectively. Then change   }
  30.                                   { zone1.spr to zone2.spr                }
  31. var    i : integer;
  32.  
  33. {----------------------------------------------------------------------------}
  34. {$I Sprites.Lib}
  35. {----------------------------------------------------------------------------}
  36.  
  37. BEGIN
  38.      clrscr;
  39.      GraphColorMode; GraphBackGround (1); Palette (2);
  40.  
  41.      LoadSprite ('Zone1.spr');        { loads sprite into var TempSprite   }
  42.  
  43.      gotoxy (2,1); write ('Press <ENTER> ');
  44.      read (Kbd,Wait);
  45.      gotoxy (2,1); write ('              ');
  46.  
  47.      Sprite := TempSprite;           { assign TempSprite as active sprite }
  48.  
  49.      for i := 1 to j do begin
  50.           PutSpriteC (k*i,50);  Delay (0);   end;
  51.      for i := 1 to j do begin
  52.           PutSpriteC (k*i,75);  Delay (25);  end;
  53.      for i := 1 to j do begin
  54.           PutSpriteC (k*i,100); Delay (50);  end;
  55.      for i := 1 to j do begin
  56.           PutSpriteC (k*i,125); Delay (100); end;
  57.      for i := 1 to j do begin
  58.           PutSpriteC (k*i,150); Delay (150); end;
  59.  
  60.      read (Kbd,Wait);
  61.      TextMode (c80);
  62.  
  63. END.
  64.