home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / progc / teglc.arj / ANIMTST2.C < prev    next >
Text File  |  1990-05-14  |  1KB  |  56 lines

  1. /*---------------------------------------------------------------------------*
  2.  |               TEGL Windows ToolKit II                 |
  3.  |          Copyright (C) 1990, TEGL Systems Corporation             |
  4.  |                All Rights Reserved.                 |
  5.  *---------------------------------------------------------------------------*/
  6.  
  7. #include <dos.h>
  8. #include <conio.h>
  9. #include <stdio.h>
  10. #include <string.h>
  11. #include <graphics.h>
  12. #include "teglsys.h"
  13.  
  14.  
  15. animateobject bounceicon;
  16.  
  17. unsigned exitoption(imagestkptr frame, msclickptr mouseclickpos)
  18.    {
  19.       abort_msg("Animation Test - The Bouncing Icon.");
  20.       return 0;
  21.    }
  22.  
  23. void main(int argc, char **argv)
  24. {
  25.     teglinit(ega640x350x16,12288);
  26.     setctrlbreakfs(exitoption);
  27.     clearteglscreen();
  28.  
  29.    init(&bounceicon);
  30.    addframe(&bounceicon,imageBLANKBUT,-15,0,14,37,10,0,0,BLACK);
  31.    sequence(&bounceicon,1);
  32.  
  33.    resetsequence(&bounceicon);
  34.    addframe(&bounceicon,imageBLANKBUT,15,0,14,37,10,0,0,BLACK);
  35.    sequence(&bounceicon,2);
  36.  
  37.    origin(&bounceicon,getmaxx() / 2,getmaxy() / 2);
  38.  
  39.    animateinit();
  40.  
  41.    clearkeyboardbuf();
  42.  
  43.    while (!kbhit())
  44.       {
  45.      sequence(&bounceicon,1);
  46.      animate(&bounceicon,destination(&bounceicon,36,0));
  47.    /*     animate(&bounceicon,10); */
  48.  
  49.      sequence(&bounceicon,2);
  50.      animate(&bounceicon,destination(&bounceicon,560,0));
  51.    /*     animate(&bounceicon,10); */
  52.       }
  53.  
  54.    teglsupervisor();
  55. }
  56.