home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
pcmag
/
vol7n14.arc
/
BOUNCE.BAS
next >
Wrap
BASIC Source File
|
1988-06-30
|
3KB
|
82 lines
DIM OPT$(10) : LIMIT=7
FOR I = 1 TO LIMIT
READ OPT$(I) 'substitute your own titles here
NEXT
DATA "BINGO", "HEX", "MASTERMIND", "SOLO", "POP THE BALLOONS"
DATA "LOTTERY NUMBERS", "EXIT TO DOS"
SCREEN 9 'EGA hi-res screen
VIEW (0,0) - (639,349), 0 'necessary mapping
WINDOW SCREEN (1,1) - (81,26) 'more necessary mapping
CIRCLE (24.4, 8.5), 9, 7 'draw the circles
PAINT (24.4, 8.5), 2, 7 'change colors if you like
COLOR 7
CIRCLE (56, 13.5), 25, 7
PAINT (56, 13.5), 4, 7
CIRCLE (17, 18), 15, 7
PAINT (17, 18), 1, 7
LOCATE 7,19 : PRINT " " 'menu instructions
LOCATE 8,19 : PRINT " MAIN MENU "
LOCATE 9,19 : PRINT " "
LOCATE 13,10 : PRINT " "
LOCATE 14,10 : PRINT " PRESS "
LOCATE 15,10 : PRINT " ENTER WHEN "
LOCATE 16,10 : PRINT " "
LOCATE 17,10 : PRINT " THE IS " 'finish this line below
LOCATE 18,10 : PRINT " "
LOCATE 19,10 : PRINT " BESIDE THE "
LOCATE 20,10 : PRINT " CHOICE YOU "
LOCATE 21,10 : PRINT " WANT "
LOCATE 22,10 : PRINT " "
CIRCLE(16.5, 17.5), 2, 7 'this prints the ball
PAINT(16, 17), 14, 7
H = 45 : V = 12 - LIMIT 'if you have long menu items you
' can decrease H by a smidgen
SPOT = 1 : OLD.SPOT = LIMIT 'initialization stuff
GOSUB CHOICES 'display menu choices
LOOP.IT: 'moves circle if no key was pressed
K$ = INKEY$ : IF SPOT > LIMIT THEN SPOT = 1
IF K$ = "" THEN
GOSUB DISPLAY.SPOT
OLD.SPOT = SPOT
SPOT = SPOT + 1
GOTO LOOP.IT
END IF
IF ASC(K$) <> 13 THEN BEEP : GOTO LOOP.IT
GOTO CHOOSE.IT
DISPLAY.SPOT:
X = V + SPOT * 2 : X = X +.5 : Y = V + OLD.SPOT * 2 : Y = Y +.5
CIRCLE (H, X), 2, 7
PAINT (H, X), 14, 7 'make the moving circle
CIRCLE (H, Y), 2, 4
PAINT (H, Y), 4, 4
X! = TIMER
WHILE TIMER < X! +.45 : WEND 'delay time for bouncing ball
RETURN
CHOOSE.IT:
CLS
IF OLD.SPOT = 1 THEN CHAIN "BINGO" 'my game programs - they all
IF OLD.SPOT = 2 THEN CHAIN "HEX" ' end with CHAIN "MENU" to
IF OLD.SPOT = 3 THEN CHAIN "MMIND" ' return to this program
IF OLD.SPOT = 4 THEN CHAIN "SOLO"
IF OLD.SPOT = 5 THEN CHAIN "POP"
IF OLD.SPOT = 6 THEN CHAIN "LOTTERY"
IF OLD.SPOT = 7 THEN END
CHOICES:
FOR I = 1 TO LIMIT
LOCATE V + 2 * I, H + 2
PRINT " " OPT$(I) SPC(17 - LEN(OPT$(I)))
NEXT
RETURN