home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / pb / library2 / anim.bas < prev    next >
BASIC Source File  |  1990-09-21  |  2KB  |  92 lines

  1. 'Program Name    : Anim.bas  move graphics character across screen
  2. 'Author          : Spectra Publishing - Tech Support  Lloyd L. Smith
  3. 'Date            : 08-24-90
  4. 'Compuserve #    : GO PCVENB, Vendor #12/Spectra, Tech Support ID 71530,2640
  5. 'Tech Support BBS: 813-625-1721, PC-Board, 8,n,1 USR HST 300 - 14.4, 24hrs
  6. 'Tech Support Fax: 813-625-1698  G2 & G3 compatible
  7. 'Tech Support Voc: 813-625-1172  voice
  8. 'Version         : Power Basic Version
  9. 'Trade Names     : Names mentioned in graphics image are the sole property
  10. '             : of their respective companies, and are there only to add
  11. '             : realism to the Graphics scene.
  12.  
  13. defint a - z
  14.  
  15. DIM Array1(2000)
  16.  
  17. SCREEN 9, , 0, 0
  18.  
  19. 'Load background screen
  20. z=&h8000:path$ = "":nam$ = "ega": Gosub MPlaneLoad
  21. 'Load foreground screen
  22. screen 9, , 0, 1
  23.  z=&h0:nam$ = "ega": Gosub MPlaneLoad
  24.  
  25. screen 9,,0,0
  26. 'LINE (445, 316)-(631, 349), 12, B
  27. x1 = 445: y1 = 316: x2 = 631: y2 = 349
  28. GET (x1, y1)-(x2, y2), Array1
  29.  
  30. LINE (445, 316)-(631, 349), 0, BF
  31.  
  32. screen 9,,0,0:Dsp = 0:os = 0
  33.  
  34. Idle:
  35. k$ = UCASE$(INKEY$): IF k$ = CHR$(27) THEN SYSTEM
  36.  
  37. IF os > -444 THEN GOSUB MovChar
  38. if os <=-444  then
  39. Screen 9,,0,0
  40. LINE (x1 + os, y1)-(x2 + os + 10, y2), 0, BF
  41.  
  42. Screen 9,,1,0
  43. LINE (x1 + os, y1)-(x2 + os + 10, y2), 0, BF
  44.  
  45. Dsp=0:os=0
  46. Screen 9,,0,0
  47. PUT (x1 + os, y1), Array1
  48. end if
  49.  
  50. FOR Dly = 1 TO 2500: NEXT Dly  'screen delay routine adjust for min flickers
  51.  
  52. GOTO Idle
  53.  
  54.  
  55. MovChar:
  56. IF Dsp = 1 THEN
  57. SCREEN 9, , 1, 0
  58. 'GET (x1 + os, y1)-(x2 + os, y2), Array1
  59. LINE (x1 + os, y1)-(x2 + os + 10, y2), 0, BF
  60. os = os - 3
  61. PUT (x1 + os, y1), Array1
  62. SCREEN 9, , 0, 1        'now display the back ground screen
  63. Dsp = 0
  64. ret = 1
  65. END IF
  66. IF ret = 1 THEN ret = 0: RETURN
  67.  
  68.  
  69. IF Dsp = 0 THEN
  70. SCREEN 9, , 0, 1
  71. 'GET (x1 + os, y1)-(x2 + os, y2), Array1
  72. LINE (x1 + os, y1)-(x2 + os + 10, y2), 0, BF
  73. os = os - 3
  74. PUT (x1 + os, y1), Array1, XOR
  75. SCREEN 9, , 1, 0        'display fore ground
  76. Dsp = 1
  77. END IF
  78.  
  79. RETURN
  80.  
  81. MPlaneLoad:
  82. 'bit plane load routine
  83. DEF SEG = &HA000
  84. OUT &H3C4, 2: OUT &H3C5, 1: BLOAD path$ + nam$ + ".BLU", z 'save bit plane 0
  85. OUT &H3C4, 2: OUT &H3C5, 2: BLOAD path$ + nam$ + ".GRN", z 'save bit plane 1
  86. OUT &H3C4, 2: OUT &H3C5, 4: BLOAD path$ + nam$ + ".RED", z 'save bit plane 2
  87. OUT &H3C4, 2: OUT &H3C5, 8: BLOAD path$ + nam$ + ".INT", z 'save bit plane 3
  88. OUT &H3C4, 2: OUT &H3C5, &HF: DEF SEG
  89. return
  90.  
  91.  
  92.