	SUBROUTINE INITSPIDR
C Routine to start a spider onto the screen
	IMPLICIT REAL*8 (A-Z)
	INCLUDE 'ARRAYS.INC/NOLIST'
	PARAMETER RANL_SPWRAP = 2,
     1		  RANU_SPWRAP = 4
	BYTE SP_INIT(4,4)
C
C Spider must be initialized so that the first time through MOVESPIDR,
C neither the SP_MAXY or the SCREEN_MAXY blocks are executed, so that
C SP_DELX & SP_DELY both remain 1, so that the spider moves onto the
C screen the first time
C Otherwise, SCREEN_MAXY will recompute SP_DELX & SP_DELY, and if
C SP_DELX turns out to be >1, the spider will remain off screen,
C causing problems in SP_WRAP check at end of MOVESPIDR
C
	DATA SP_INIT / 	BORDER_MINX,RANL_SPIUP , 1, 1,
     1			BORDER_MINX,BORDER_MAXY, 1,-1,
     2			BORDER_MAXX,RANL_SPIUP ,-1, 1,
     3			BORDER_MAXX,BORDER_MAXY,-1,-1 /
	INTEGER*4 RANDINT,IDX
C
C Get a random index into the spider initialization values array
C Then use values in this array to initialize the spider
C Values are, in order:
C  Initial X coord
C  Initial Y coord
C  Delta X for each screen update for first path
C  Delta Y for each screen update for first path
C  Initial X direction
C  Initial Y direction
C  Number of times to go completely across screen
C  See MOVESPIDR for reason for last two values
C
	IDX = RANDINT(RANL_SPINIT,RANU_SPINIT)
	TARG_XLOC = SP_INIT(1,IDX)
	TARG_YLOC = SP_INIT(2,IDX)
	SP_DELX   = 1
	SP_DELY   = 1
	SP_XDIR   = SP_INIT(3,IDX)
	SP_YDIR   = SP_INIT(4,IDX)
	SP_WRAP   = RANDINT(RANL_SPWRAP,RANU_SPWRAP)
	SP_MAXY   = 0
	SP_INC    = 0
C
C Request that the terminal bell ring as a warning (see WRTSCR)
C
	BELL_COUNT = BELLCNT_SPID
	RETURN
	END
