home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Boston 2
/
boston-2.iso
/
DOS
/
PROGRAM
/
BASIC
/
POWBASIC
/
LIBRARY2
/
GRAPH2.ZIP
/
ANIM.BAS
next >
Wrap
BASIC Source File
|
1990-09-21
|
2KB
|
92 lines
'Program Name : Anim.bas move graphics character across screen
'Author : Spectra Publishing - Tech Support Lloyd L. Smith
'Date : 08-24-90
'Compuserve # : GO PCVENB, Vendor #12/Spectra, Tech Support ID 71530,2640
'Tech Support BBS: 813-625-1721, PC-Board, 8,n,1 USR HST 300 - 14.4, 24hrs
'Tech Support Fax: 813-625-1698 G2 & G3 compatible
'Tech Support Voc: 813-625-1172 voice
'Version : Power Basic Version
'Trade Names : Names mentioned in graphics image are the sole property
' : of their respective companies, and are there only to add
' : realism to the Graphics scene.
defint a - z
DIM Array1(2000)
SCREEN 9, , 0, 0
'Load background screen
z=&h8000:path$ = "":nam$ = "ega": Gosub MPlaneLoad
'Load foreground screen
screen 9, , 0, 1
z=&h0:nam$ = "ega": Gosub MPlaneLoad
screen 9,,0,0
'LINE (445, 316)-(631, 349), 12, B
x1 = 445: y1 = 316: x2 = 631: y2 = 349
GET (x1, y1)-(x2, y2), Array1
LINE (445, 316)-(631, 349), 0, BF
screen 9,,0,0:Dsp = 0:os = 0
Idle:
k$ = UCASE$(INKEY$): IF k$ = CHR$(27) THEN SYSTEM
IF os > -444 THEN GOSUB MovChar
if os <=-444 then
Screen 9,,0,0
LINE (x1 + os, y1)-(x2 + os + 10, y2), 0, BF
Screen 9,,1,0
LINE (x1 + os, y1)-(x2 + os + 10, y2), 0, BF
Dsp=0:os=0
Screen 9,,0,0
PUT (x1 + os, y1), Array1
end if
FOR Dly = 1 TO 2500: NEXT Dly 'screen delay routine adjust for min flickers
GOTO Idle
MovChar:
IF Dsp = 1 THEN
SCREEN 9, , 1, 0
'GET (x1 + os, y1)-(x2 + os, y2), Array1
LINE (x1 + os, y1)-(x2 + os + 10, y2), 0, BF
os = os - 3
PUT (x1 + os, y1), Array1
SCREEN 9, , 0, 1 'now display the back ground screen
Dsp = 0
ret = 1
END IF
IF ret = 1 THEN ret = 0: RETURN
IF Dsp = 0 THEN
SCREEN 9, , 0, 1
'GET (x1 + os, y1)-(x2 + os, y2), Array1
LINE (x1 + os, y1)-(x2 + os + 10, y2), 0, BF
os = os - 3
PUT (x1 + os, y1), Array1, XOR
SCREEN 9, , 1, 0 'display fore ground
Dsp = 1
END IF
RETURN
MPlaneLoad:
'bit plane load routine
DEF SEG = &HA000
OUT &H3C4, 2: OUT &H3C5, 1: BLOAD path$ + nam$ + ".BLU", z 'save bit plane 0
OUT &H3C4, 2: OUT &H3C5, 2: BLOAD path$ + nam$ + ".GRN", z 'save bit plane 1
OUT &H3C4, 2: OUT &H3C5, 4: BLOAD path$ + nam$ + ".RED", z 'save bit plane 2
OUT &H3C4, 2: OUT &H3C5, 8: BLOAD path$ + nam$ + ".INT", z 'save bit plane 3
OUT &H3C4, 2: OUT &H3C5, &HF: DEF SEG
return