home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff343.lzh / SnakePit / SnakePitSrc.lzh / Snake.c < prev    next >
C/C++ Source or Header  |  1990-04-07  |  4KB  |  117 lines

  1. /*
  2.  * MKSoft SnakePit  Copyright (c) 1988  by Michael Sinz
  3.  *
  4.  * MAIN startup program...
  5.  */
  6.  
  7. /*
  8.  *                                  SnakePit
  9.  *                                     by
  10.  *                                Michael Sinz
  11.  *
  12.  *                  Copyright (c) 1988 - MKSoft Development
  13.  *
  14.  * SnakePit is a simple and yet addictive game in which you must get the
  15.  * snake (you) off of the screen.  There are, however, some rough spots
  16.  * and some obstacles that may need to be overcome.
  17.  *
  18.  * This game was written as an example of how to do a game that is as
  19.  * system friendly as possible.  During development, there was joystick
  20.  * control of the snake and I was able to have my little brother play it
  21.  * in the top-half of a 400-line screen while I was working on code in the
  22.  * bottom half.  Since this is a quick (1-week) hack that was done back in
  23.  * 1988 and since it was written in pre-ANSI Manx days, the code looks a
  24.  * bit ugly.  I hope you can understand.
  25.  *
  26.  * If you come up with some good screens for SnakePit, please send them
  27.  * to me.
  28.  *
  29.  * ************************************************************************
  30.  *
  31.  *        Reading legal mush can turn your brain into guacamole!
  32.  *
  33.  *            So here is some of that legal mush:
  34.  *
  35.  * Permission is hereby granted to distribute this program's source,
  36.  * executable, and documentation for non-commercial purposes, so long as
  37.  * the copyright notices are not removed from the sources, executable or
  38.  * documentation.  This program may not be distributed for a profit
  39.  * without the express written consent of the author Michael Sinz.
  40.  *
  41.  * This program is not in the public domain.
  42.  *
  43.  * Fred Fish is expressly granted permission to distribute this program's
  44.  * source and executable as part of the "Fred Fish freely redistributable
  45.  * Amiga software library."
  46.  *
  47.  * Permission is expressly granted for this program and it's source to be
  48.  * distributed as part of the Amicus Amiga software disks, and the First
  49.  * Amiga User Group's Hot Mix disks.
  50.  *
  51.  * ************************************************************************
  52.  *
  53.  * If you have any comments or suggestions (or bug reports :-(), you can
  54.  * contact MKSoft Development via
  55.  *
  56.  *     BIX:        "msinz"
  57.  * or    USENET:        "rutgers!cbmvax!mks"
  58.  * or    INTERNET:    "mks@cbmvax.commodore.com"
  59.  *
  60.  * or via USnail at the address below.
  61.  *
  62.  * If you enjoy this program, and would like to see more quality software
  63.  * for the Amiga, please help "feed the programmer" For only $20 you will
  64.  * get a disk with the latest and greatest of MKSoft Development.
  65.  *
  66.  *         MKSoft Development
  67.  *         163 Appledore Drive
  68.  *         Downingtown, PA 19335
  69.  *
  70.  * ************************************************************************
  71.  */
  72.  
  73. #include    "Snake.h"
  74.  
  75. struct    IntuitionBase    *IntuitionBase;
  76. struct    GfxBase        *GfxBase;
  77.     char        *Save_File;
  78.  
  79. main(argc,argv)    int    argc;
  80.         char    *argv[];
  81. {
  82. register    struct    WBStartup    *WBenchMsg;
  83. register    struct    WBArg        *p;
  84. register        BPTR        lock;
  85.  
  86.     if (argc) Save_File=argv[argc-1];
  87.     else
  88.     {
  89.         WBenchMsg=(struct WBStartup *)argv;
  90.         p=WBenchMsg->sm_ArgList;
  91.         if (WBenchMsg->sm_NumArgs>1L) p++;
  92.         Save_File=p->wa_Name;
  93.         if (p->wa_Lock) lock=(BPTR)CurrentDir(p->wa_Lock);
  94.     }
  95.  
  96.     if (IntuitionBase=OpenLibrary("intuition.library",33L))
  97.     {
  98.         if (GfxBase=OpenLibrary("graphics.library",33L))
  99.         {
  100.  
  101.             Init_Sound();
  102.             Sound_Dead();
  103.  
  104. /* Now, let's call our normal MAIN... */
  105.             MyMain();
  106.  
  107.             Stop_Sound();
  108.  
  109.             CloseLibrary(GfxBase);
  110.         }
  111.         CloseLibrary(IntuitionBase);
  112.     }
  113.  
  114. /* Return to old CurrentDir */
  115.     if (!argc) if (p->wa_Lock) lock=(BPTR)CurrentDir(lock);
  116. }
  117.