      (* ********************************************************* *)
      (*                                                           *)
      (*  This program presents a simple example of XOR animation. *)
      (*  None of the multipage techniques are used here.          *)
      (*                                                           *)
      (*                          (c) Donald L. Pavia              *)
      (*        Ver 1.0           Department of Chemistry          *)
      (*     February 1986        Western Washington University    *)
      (*                          Bellingham, Washington 98225     *)
      (*                                                           *)
      (* ********************************************************* *)

program Demo5;

var   start,finish,counter,step,hold,i,position : integer;

{----------------------------------------------------------------------------}
{$I Sprites.Lib}
{----------------------------------------------------------------------------}

BEGIN

     LoadTable ('Demo5.Tab');

  REPEAT
     clrscr;
     GraphColorMode; GraphBackGround (1); Palette (2);

     start := 1; finish := 12; step := 0; counter := 0;
     position := 150; hold := 125;

     TextColor (1);
     gotoxy (10,4); write ('XOR ANIMATION');

     REPEAT
       for i := start to finish do
            begin
                 Sprite := Table[i];  XorSpriteC (position,100);

                 Sprite := Table[i+12]; XorSpriteC (position+12,120);

                 Delay (Hold);

                 Sprite := Table[i];  XorSpriteC (position,100);

                 Sprite := Table[i+12]; XorSpriteC (position+12,120);

                 position := position + Step; counter := counter + 1;
            end;
            Delay (1750);

     UNTIL (position >= 300) or (counter >= 40);

     gotoxy (5,23); write ('Repeat Again? Y/N ?  ');
     repeat
            read (Kbd,Wait);
     until UpCase(Wait) in ['Y','N'];

  UNTIL UpCase(Wait) = 'N';

     TextMode (c80);

END.
