' ******************************************************************* ' **         DEMO - Program to Demonstrate Animation               ** P$' **          Using Files Created by "The Designer"                ** .' **  Copyright 1983, by Jan B. Young.  Permission is granted to   ** 8' **  all purchasers to copy and modify this program for non-      ** .B' **  commercial uses, providing the copyright notice is retained. ** xL' ******************************************************************* V'  `' ******************************************************************* j' **              Put Introduction Panel on Screen                 ** ^t' ******************************************************************* ~' : ,                  :Clear screen ' ,: "T H E" ' ,: "M O U S E" ' ,: "An Animation Demonstration" ' ,: "Copyright 1983 by Jan B. Young" <' ,: "Press Any Key to Continue" I'X$$() ' ******************************************************************* ' **              Get Sprite and Load in Matrix                    ** '' ******************************************************************* E' "A:MOUSE.SPR"   AS # ' #,RES,PAL,ARR,WID,HGHT        :Defines parameters for the mouse ' MOUSE(ARR)  ( I  ARR                       :Load mouse into array 
(#,J(),J(),J(),J() (P(MOUSE(I)) ( N   )(( PN,J(N) 12( N 9<( I BF( # P( ******************************************************************* Z( **               Put background on Screen                        **  d( ******************************************************************* =n( "A:MAZE.RES"   AS # x( #,RES,BAK,PAL                 :Defines parameters for maze ( # ( RES: BAK,PAL:         :Clear screen ( SEG                        :Locate screen buffer /( "A:MAZE",                     :Put maze on screen 9( SEG ( ******************************************************************* ( **                      Animate                                  ** ( ******************************************************************* _(HPOS:VPOS:HNEW:VNEW:DIR$"E"              :Initial values (T  ((,,))d((,,)) ( T ( (HPOS,VPOS),MOUSE                             :Put mouse on screen  ( LINE (HPOS-5,VPOS-3)-(HPOS+18,VPOS+14),1,B    'Debugging only f) +                               :Determines freedom to move ) LOCATE 20,20:PRINT NORTH:LOCATE 21,21:PRINT EAST:LOCATE 22,20:PRINT SOUTH:LOCATE 21,19:PRINT WEST:LOCATE 21,30:PRINT DIR$  'Delete REM for debugging ) DIR$  "E"   J) \") DIR$  "N"   )           :DIR$ is direction of motion u,) DIR$  "S"   l* 6) DIR$  "W"   + @) *** Now going east - logic selects next move *** J) EAST   ) T) SOUTH   r)         :Value East=1 means OK to go east d^) NORTH   +        :Value East=0 means path east is blocked h) +                        :See GOTO line for direction chosen r) NORTH  + |)I: I     + : + ) SOUTH   ) ) NORTH   ) ) + 5)I: IL  + : + K) NORTH   ) k)I: IL  + : + )I: I333  + ) IL  + : + ) *** Now going north- logic selects next move *** ) NORTH   * ) WEST   * ) EAST   +  ) + 3* EAST  + S*I: I     + : + h* WEST   D* }&* EAST   :* 0* + :*I: IL  + : + D* EAST   X* N* IL  + : + X*I: I  + b*I: I  + : + Gl* *** Now going south- logic selects next move *** ]v* SOUTH   * r* WEST   * * EAST   + * + * EAST  + *I: I     + : + * IL~  + : + * WEST   * 	* EAST   * * + 3*I: IL  + : + H* EAST   * h*I: IL  + : + *I: I333  + + IL  + : + + *** Now going west- logic selects next move *** + WEST   R+  + NORTH   >+  *+ SOUTH   +  4+ + 1 >+ SOUTH  + Q H+I: I     + : + g R+ NORTH   z+ } \+ SOUTH   p+  f+ +  p+I: IL  + : +  z+ SOUTH   +  +I: IL  + : +  +I: I333  + !+ IL  + : + \!+DIR$"W":HNEWHNEW: +     :4 statements calculate next position {!+DIR$"N":VNEWVPOS: + !+DIR$"E":HNEWHPOS: + !+DIR$"S":VNEWVPOS: + "+ (HPOS,VPOS),MOUSE              :remove mouse from old position D"+ LINE (HPOS-5,VPOS-3)-(HPOS+18,VPOS+14),0,B   'Debugging only ~"+HPOSHNEW:VPOSVNEW                :Change position "+ (                           :Go back to start  #+ ******************************************************************* J#+ **                 "Feel" for open paths                         ** #, ** Note: Mouse occupies a box extending horizontally from        ** #, ** HPOS-6 to HPOS+19 and vertically from VPOS-4 to VPOS+15       ** ($, ******************************************************************* 8$$, DIR$"E" $.,    (HPOS,VPOS)  (HPOS,VPOS)                             NORTH : NORTH $8,    (HPOS,VPOS)  (HPOS,VPOS)                          SOUTH : SOUTH /%B,    (HPOS,VPOS)  EAST : EAST 8%L,    >%V, N%`, DIR$"W" %j,    (HPOS,VPOS)  (HPOS,VPOS)                               NORTH : NORTH &t,    (HPOS,VPOS)  (HPOS,VPOS)                             SOUTH : SOUTH E&~,    (HPOS,VPOS)  WEST : WEST N&,    T&, d&, DIR$"N" &,    (HPOS,VPOS)  (HPOS,VPOS)                               WEST : WEST (',    (HPOS,VPOS)  (HPOS,VPOS)                             EAST : EAST ^',     (HPOS,VPOS)  NORTH   : NORTH   g',    m', }', DIR$"S" ',    (HPOS,VPOS)  (HPOS,VPOS)                             WEST : WEST A(,    (HPOS,VPOS)  (HPOS,VPOS)                           EAST : EAST t(,     (HPOS,VPOS)  SOUTH : SOUTH }( -    (
-   ,VPOS)                           EAST : EAST t(,     (HPOS,VPOS)  SOUTH : SOUTH