Author Topic: DONKEY.BAS adapted to qb64  (Read 2206 times)

0 Members and 1 Guest are viewing this topic.

Offline +KZ

  • Newbie
  • Posts: 21
  • an ugly avatar :)
    • View Profile
DONKEY.BAS adapted to qb64
« on: May 14, 2020, 06:46:53 pm »
Hi, only for fun i tried to search "DONKEY.BAS" for qb64/qbasic and i found a link on Wikipedia (Donkey.bas (Qbasic) link) but it runned with a unplayable speed, then i added some Delays to program and you can now simply compile and play :D

(the only problem is the delayed sounds, if you have time, you can replace SOUNDs with _SNDLOAD/PLAY/STOP/etc...)

Code: QB64: [Select]
  1. '==============
  2.  
  3. ' **** Donkey ****
  4.  
  5. 'THIS IS ONLY AN ADAPTATION FROM QuickBasic DONKEY.BAS TO QB64
  6. 'Adapted Because DONKEY.BAS (QuickBasic) run so fast when compile with QB64
  7.  
  8. '**************
  9. 'Used QuickBasic DONKEY.BAS (from https://web.archive.org/web/20050405104141/http://www.jujusoft.com/drivey/DONKEYQB.BAS.html) as base
  10. 'Used GW-BASIC DONKEY.BAS (from http://peyre.x10.mx/GWBASIC/) as guide
  11. 'Used "PC-BASIC" (https://robhagemans.github.io/pcbasic/) to run GW-BASIC DONKEY.BAS
  12.  
  13. 'Added some DELAYs to make the program run like GW-BASIC version (on PC-BASIC)
  14.  
  15. 'TO DO:
  16. ' * If possible, Make the game sound dont delay (For example when you press space)
  17.  
  18. '===============
  19.  
  20. REM The IBM Personal Computer Donkey
  21. REM Version 1.10 (C)Copyright IBM Corp 1981, 1982
  22. REM Licensed Material - Program Property of IBM
  23. DEF SEG: POKE 106, 0
  24. SAMPLES$ = "NO"
  25. DIM CAR%(900)
  26. GOTO 1010
  27. SAMPLES$ = "YES"
  28. 1010 KEY OFF: SCREEN 0, 1: COLOR 15, 0, 0: WIDTH 40: CLS: LOCATE 5, 19: PRINT "IBM"
  29. LOCATE 7, 12, 0: PRINT "Personal Computer"
  30. COLOR 10, 0: LOCATE 10, 9, 0: PRINT CHR$(213) + STRING$(21, 205) + CHR$(184)
  31. LOCATE 11, 9, 0: PRINT CHR$(179) + "       DONKEY        " + CHR$(179)
  32. LOCATE 12, 9, 0: PRINT CHR$(179) + STRING$(21, 32) + CHR$(179)
  33. LOCATE 13, 9, 0: PRINT CHR$(179) + "    Version 1.10     " + CHR$(179)
  34. LOCATE 14, 9, 0: PRINT CHR$(212) + STRING$(21, 205) + CHR$(190)
  35. COLOR 15, 0: LOCATE 17, 4, 0: PRINT "(C) Copyright IBM Corp 1981, 1982"
  36. COLOR 14, 0: LOCATE 23, 7, 0: PRINT "Press space bar to continue"
  37. 1100 IF INKEY$ <> "" THEN GOTO 1100
  38. 1110 CMD$ = INKEY$
  39. IF CMD$ = "" THEN GOTO 1110
  40. IF CMD$ = CHR$(27) THEN GOTO 1298
  41. IF CMD$ = " " THEN GOTO 1160
  42. GOTO 1110
  43. 1160 DEF SEG = 0
  44. IF (PEEK(&H410) AND &H30) <> &H30 THEN DEF SEG: GOTO 1291
  45. WIDTH 80: CLS: LOCATE 3, 1
  46. PRINT "HOLD IT!"
  47. PRINT "YOU'RE NOT USING THE COLOR/GRAPHICS MONITOR ADAPTER!"
  48. PRINT "THIS PROGRAM USES GRAPHICS AND REQUIRES THAT ADAPTER."
  49. PRINT "PRESS THE SPACE BAR TO CONTINUE."
  50. 1240 IF INKEY$ <> "" THEN GOTO 1240
  51. 1250 CMD$ = INKEY$
  52. IF CMD$ = "" THEN GOTO 1250
  53. IF CMD$ = CHR$(27) THEN GOTO 1298
  54. IF CMD$ = " " THEN GOTO 1298
  55. GOTO 1250
  56. 1291 KEY OFF
  57. PLAY "p16"
  58. GOTO 1300
  59. 1295 COLOR 31, 0, 0
  60. PRINT "THIS PROGRAM REQUIRES ADVANCED BASIC -- USE COMMAND 'BASICA'": COLOR 15, 0, 0: FOR I = 1 TO 9000: NEXT: RESUME 1298
  61. 1298 ON ERROR GOTO 0
  62. SCREEN 0, 1: COLOR 7, 0, 0: CLS: END
  63. 1300 REM
  64. DEFINT A-Y
  65. SCREEN 1, 0: COLOR 8, 1
  66. DIM Q%(500)
  67. DIM D1%(150), D2%(150), C1%(200), C2%(200)
  68. DIM DNK%(300)
  69. GOSUB 1940
  70. GOSUB 1780
  71. DIM B%(300)
  72. FOR I = 2 TO 300: B%(I) = -16384 + 192: NEXT
  73. B%(0) = 2: B%(1) = 193
  74. 1540 REM
  75. CX = 110: CLS
  76. LINE (0, 0)-(305, 199), , B
  77. LINE (6, 6)-(97, 195), 1, BF
  78. LINE (183, 6)-(305, 195), 1, BF
  79. LOCATE 3, 5: PRINT "Donkey"
  80. LOCATE 3, 29: PRINT "Driver"
  81. LOCATE 19, 25: PRINT "Press Space ";
  82. LOCATE 20, 25: PRINT "Bar to switch";
  83. LOCATE 21, 25: PRINT "lanes ";
  84. LOCATE 23, 25: PRINT "Press ESC ";
  85. LOCATE 24, 25: PRINT "to exit ";
  86. FOR Y = 4 TO 199 STEP 20: LINE (140, Y)-(140, Y + 10): NEXT
  87. CY = 105: CX = 105
  88. LINE (100, 0)-(100, 199): LINE (180, 0)-(180, 199)
  89. 1670 LOCATE 5, 6: PRINT SD: LOCATE 5, 31: PRINT SM
  90. CY = CY - 4: IF CY < 60 THEN 2230
  91. PUT (CX, CY), CAR%(), PRESET
  92. DX = 105 + 42 * INT(RND * 2)
  93. FOR Y = (RND * -4) * 8 TO 124 STEP 6
  94.  
  95.     'Delay added
  96.     _DELAY 0.05
  97.  
  98.     SOUND 20000, 0.9 'Modified SOUND Duration
  99.     A$ = INKEY$: IF A$ = CHR$(27) THEN 1298 ELSE POKE 106, 0: IF LEN(A$) > 0 THEN LINE (CX, CY)-(CX + 28, CY + 44), 0, BF: CX = 252 - CX: PUT (CX, CY), CAR%(), PRESET: SOUND 200, 1
  100.     IF Y >= 3 THEN PUT (DX, Y), DNK%(), PSET
  101.     IF CX = DX AND Y + 25 >= CY THEN 2060
  102.     IF Y AND 3 THEN PUT (140, 6), B%()
  103. NEXT: LINE (DX, 124)-(DX + 32, 149), 0, BF: GOTO 1670
  104. 1780 CLS
  105. DRAW "S8C3"
  106. DRAW "BM12,1r3m+1,3d2R1ND2u1r2d4l2u1l1"
  107. DRAW "d7R1nd2u2r3d6l3u2l1d3m-1,1l3"
  108. DRAW "m-1,-1u3l1d2l3u6r3d2nd2r1u7l1d1l2"
  109. DRAW "u4r2d1nd2R1U2"
  110. DRAW "M+1,-3"
  111. DRAW "BD10D2R3U2M-1,-1L1M-1,1"
  112. DRAW "BD3D1R1U1L1BR2R1D1L1U1"
  113. DRAW "BD2BL2D1R1U1L1BR2R1D1L1U1"
  114. DRAW "BD2BL2D1R1U1L1BR2R1D1L1U1"
  115. LINE (0, 0)-(40, 60), , B
  116. PAINT (1, 1)
  117. REM DIM CAR%(900)
  118. GET (1, 1)-(28, 44), CAR%() 'Modified "29" and "45" for a line that appeared on the side of the car
  119. 1940 CLS
  120. DRAW "S08"
  121. DRAW "BM14,18"
  122. DRAW "M+2,-4R8M+1,-1U1M+1,+1M+2,-1"
  123. DRAW "M-1,1M+1,3M-1,1M-1,-2M-1,2"
  124. DRAW "D3L1U3M-1,1D2L1U2L3D2L1U2M-1,-1"
  125. DRAW "D3L1U5M-2,3U1"
  126. PAINT (21, 14), 3
  127. PRESET (37, 10): PRESET (40, 10)
  128. PRESET (37, 11): PRESET (40, 11)
  129. GET (13, 0)-(45, 25), DNK%()
  130. 2060 SD = SD + 1: LOCATE 14, 6: PRINT "BOOM!"
  131. GET (DX, Y)-(DX + 16, Y + 25), D1%()
  132. D1X = DX: D1Y = Y: D2X = DX + 17
  133. GET (DX + 17, Y)-(DX + 31, Y + 25), D2%()
  134. GET (CX, CY)-(CX + 14, CY + 44), C1%()
  135. GET (CX + 15, CY)-(CX + 28, CY + 44), C2%()
  136. C1X = CX: C1Y = CY: C2X = CX + 15
  137. FOR P = 6 TO 0 STEP -1: Z = 1 / (2 ^ P): Z1 = 1 - Z
  138.  
  139.     'Delay added too
  140.     _DELAY 0.20
  141.  
  142.     PUT (C1X, C1Y), C1%(): PUT (C2X, C1Y), C2%()
  143.     PUT (D1X, D1Y), D1%(): PUT (D2X, D1Y), D2%()
  144.     C1X = CX * Z1: D1Y = Y * Z1: C2X = C2X + (291 - C2X) * Z
  145.     D1X = DX * Z1: C1Y = C1Y + (155 - C1Y) * Z: D2X = D2X + (294 - D2X) * Z
  146.     PUT (C1X, C1Y), C1%(): PUT (C2X, C1Y), C2%()
  147.     PUT (D1X, D1Y), D1%(): PUT (D2X, D1Y), D2%()
  148. SOUND 37 + RND * 200, 4: NEXT
  149. FOR Y = 1 TO 2000: NEXT
  150.  
  151. 'More Delay
  152. _DELAY 0.25
  153.  
  154. CLS: GOTO 1540
  155. 2230 SM = SM + 1: LOCATE 7, 25: PRINT "Donkey loses!"
  156. FOR Y = 1 TO 1000: NEXT
  157. CLS: GOTO 1540
  158.  



 
Captura de pantalla 2020-05-14 a las 6.43.08 p.m..png
Captura de pantalla 2020-05-14 a las 6.42.57 p.m..png
* Captura de pantalla 2020-05-14 a las 6.42.57 p.m..png (Filesize: 14.88 KB, Dimensions: 634x398, Views: 368)
« Last Edit: May 21, 2020, 07:02:06 pm by +KZ »
google translate :0

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Donkey.bas adapted to qb64
« Reply #1 on: May 14, 2020, 07:09:53 pm »
Hey cute game, thanks for sharing!

Offline TerryRitchie

  • Seasoned Forum Regular
  • Posts: 495
  • Semper Fidelis
    • View Profile
Re: Donkey.bas adapted to qb64
« Reply #2 on: May 14, 2020, 07:15:35 pm »
Yeah, IBM included donkey.BAS on their DOS installation diskettes. I know it came with version 3 of IBM DOS, not sure about others. Good find.
In order to understand recursion, one must first understand recursion.

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Donkey.bas adapted to qb64
« Reply #3 on: May 14, 2020, 08:22:22 pm »
LOL fun game! Thanks for updating it. :)
Reminds me of my Race Car game I made last year. You can check it out here if you wish:

https://www.qb64.org/forum/index.php?topic=1510.0


Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Donkey.bas adapted to qb64
« Reply #4 on: May 17, 2020, 07:56:16 pm »
Wow
I find fine thess old games
but all these spaghetti are a temptation!

So I digest them by GOSUB/RETURN meatballs! :-)
Code: QB64: [Select]
  1. '==============
  2.  
  3. ' **** Donkey ****
  4.  
  5. 'THIS IS ONLY AN ADAPTATION FROM QuickBasic DONKEY.BAS TO QB64
  6. 'Adapted Because DONKEY.BAS (QuickBasic) run so fast when compile with QB64
  7.  
  8. '-----------------
  9. ' 2020 05 18 1.43 AM   porting from spaghetti structure(GOTO) to meatball structure (GOSUB)
  10. '**************
  11. 'Used QuickBasic DONKEY.BAS (from https://web.archive.org/web/20050405104141/http://www.jujusoft.com/drivey/DONKEYQB.BAS.html) as base
  12. 'Used GW-BASIC DONKEY.BAS (from http://peyre.x10.mx/GWBASIC/) as guide
  13. 'Used "PC-BASIC" (https://robhagemans.github.io/pcbasic/) to run GW-BASIC DONKEY.BAS
  14.  
  15. 'Added some DELAYs to make the program run like GW-BASIC version (on PC-BASIC)
  16.  
  17. 'TO DO:
  18. ' * If possible, Make the game sound dont delay (For example when you press space)
  19.  
  20. '===============
  21.  
  22. REM The IBM Personal Computer Donkey
  23. REM Version 1.10 (C)Copyright IBM Corp 1981, 1982
  24. REM Licensed Material - Program Property of IBM
  25. DEF SEG: POKE 106, 0
  26. SAMPLES$ = "NO"
  27. DIM CAR%(900)
  28. GOSUB StartScreen 'GOTO 1010
  29. SAMPLES$ = "YES"
  30.  
  31.  
  32. StartGraphic:
  33. DEFINT A-Y
  34. SCREEN 1, 0: COLOR 8, 1
  35. DIM Q%(500)
  36. DIM D1%(150), D2%(150), C1%(200), C2%(200)
  37. DIM DNK%(300)
  38. GOSUB MakeDonkey
  39. GOSUB MakeCar
  40. DIM B%(300)
  41. FOR I = 2 TO 300: B%(I) = -16384 + 192: NEXT
  42. B%(0) = 2: B%(1) = 193
  43.  
  44.    1540 REM
  45.     CX = 110: CLS
  46.     LINE (0, 0)-(305, 199), , B
  47.     LINE (6, 6)-(97, 195), 1, BF
  48.     LINE (183, 6)-(305, 195), 1, BF
  49.     LOCATE 3, 5: PRINT "Donkey"
  50.     LOCATE 3, 29: PRINT "Driver"
  51.     LOCATE 19, 25: PRINT "Press Space ";
  52.     LOCATE 20, 25: PRINT "Bar to switch";
  53.     LOCATE 21, 25: PRINT "lanes ";
  54.     LOCATE 23, 25: PRINT "Press ESC ";
  55.     LOCATE 24, 25: PRINT "to exit ";
  56.     FOR Y = 4 TO 199 STEP 20: LINE (140, Y)-(140, Y + 10): NEXT
  57.     CY = 105: CX = 105
  58.     LINE (100, 0)-(100, 199): LINE (180, 0)-(180, 199)
  59.     DO '1670
  60.         LOCATE 5, 6: PRINT SD: LOCATE 5, 31: PRINT SM
  61.         CY = CY - 4: IF CY < 60 THEN GOSUB DonkeyLoss: EXIT DO '2230
  62.         PUT (CX, CY), CAR%(), PRESET
  63.         DX = 105 + 42 * INT(RND * 2)
  64.         FOR Y = (RND * -4) * 8 TO 124 STEP 6
  65.  
  66.             'Delay added
  67.             _DELAY 0.05
  68.  
  69.             SOUND 20000, 0.9 'Modified SOUND Duration
  70.             A$ = INKEY$: IF A$ = CHR$(27) THEN GOSUB Escape ELSE POKE 106, 0:
  71.             IF LEN(A$) > 0 THEN LINE (CX, CY)-(CX + 28, CY + 44), 0, BF: CX = 252 - CX: PUT (CX, CY), CAR%(), PRESET: SOUND 200, 1
  72.             IF Y >= 3 THEN PUT (DX, Y), DNK%(), PSET
  73.             IF CX = DX AND Y + 25 >= CY THEN GOSUB Collision: EXIT DO '2060
  74.             IF Y AND 3 THEN PUT (140, 6), B%()
  75.         NEXT
  76.         : LINE (DX, 124)-(DX + 32, 149), 0, BF:
  77.     LOOP 'GOTO 1670
  78.  
  79. Collision:
  80. SD = SD + 1: LOCATE 14, 6: PRINT "BOOM!"
  81. GET (DX, Y)-(DX + 16, Y + 25), D1%()
  82. D1X = DX: D1Y = Y: D2X = DX + 17
  83. GET (DX + 17, Y)-(DX + 31, Y + 25), D2%()
  84. GET (CX, CY)-(CX + 14, CY + 44), C1%()
  85. GET (CX + 15, CY)-(CX + 28, CY + 44), C2%()
  86. C1X = CX: C1Y = CY: C2X = CX + 15
  87. FOR P = 6 TO 0 STEP -1: Z = 1 / (2 ^ P): Z1 = 1 - Z
  88.  
  89.     'Delay added too
  90.     _DELAY 0.20
  91.  
  92.     PUT (C1X, C1Y), C1%(): PUT (C2X, C1Y), C2%()
  93.     PUT (D1X, D1Y), D1%(): PUT (D2X, D1Y), D2%()
  94.     C1X = CX * Z1: D1Y = Y * Z1: C2X = C2X + (291 - C2X) * Z
  95.     D1X = DX * Z1: C1Y = C1Y + (155 - C1Y) * Z: D2X = D2X + (294 - D2X) * Z
  96.     PUT (C1X, C1Y), C1%(): PUT (C2X, C1Y), C2%()
  97.     PUT (D1X, D1Y), D1%(): PUT (D2X, D1Y), D2%()
  98.     SOUND 37 + RND * 200, 4:
  99. FOR Y = 1 TO 2000: NEXT
  100.  
  101. 'More Delay
  102. _DELAY 0.25
  103.  
  104. CLS: 'GOTO 1540
  105.  
  106. DonkeyLoss:
  107. SM = SM + 1: LOCATE 7, 25: PRINT "Donkey loses!"
  108. FOR Y = 1 TO 1000: NEXT
  109. CLS: 'GOTO 1540
  110.  
  111. StartScreen:
  112. KEY OFF: SCREEN 0, 1: COLOR 15, 0, 0: WIDTH 40: CLS: LOCATE 5, 19: PRINT "IBM"
  113. LOCATE 7, 12, 0: PRINT "Personal Computer"
  114. COLOR 10, 0: LOCATE 10, 9, 0: PRINT CHR$(213) + STRING$(21, 205) + CHR$(184)
  115. LOCATE 11, 9, 0: PRINT CHR$(179) + "       DONKEY        " + CHR$(179)
  116. LOCATE 12, 9, 0: PRINT CHR$(179) + STRING$(21, 32) + CHR$(179)
  117. LOCATE 13, 9, 0: PRINT CHR$(179) + "    Version 1.10     " + CHR$(179)
  118. LOCATE 14, 9, 0: PRINT CHR$(212) + STRING$(21, 205) + CHR$(190)
  119. COLOR 15, 0: LOCATE 17, 4, 0: PRINT "(C) Copyright IBM Corp 1981, 1982"
  120. COLOR 14, 0: LOCATE 23, 7, 0: PRINT "Press space bar to continue"
  121.     CMD$ = INKEY$
  122.     IF CMD$ = CHR$(27) THEN GOSUB Escape 'GOTO 1298
  123.     IF CMD$ = " " THEN GOSUB TestAdapter 'GOTO 1160
  124.  
  125. TestAdapter:
  126. DEF SEG = 0
  127. IF (PEEK(&H410) AND &H30) = &H30 THEN
  128.     WIDTH 80: CLS: LOCATE 3, 1
  129.     PRINT "HOLD IT!"
  130.     PRINT "YOU'RE NOT USING THE COLOR/GRAPHICS MONITOR ADAPTER!"
  131.     PRINT "THIS PROGRAM USES GRAPHICS AND REQUIRES THAT ADAPTER."
  132.     PRINT "PRESS THE SPACE BAR TO CONTINUE."
  133.     DEF SEG
  134.     DO WHILE INKEY$ = ""
  135.         CMD$ = INKEY$
  136.         IF CMD$ = CHR$(27) THEN GOSUB Escape 'GOTO 1298
  137.         IF CMD$ = " " THEN GOSUB Escape 'GOTO 1298
  138.     LOOP
  139.     DEF SEG: GOSUB TestBasic 'GOTO 1291
  140.     GOSUB StartGraphic
  141.  
  142. Escape:
  143. SCREEN 0, 1: COLOR 7, 0, 0: CLS: END
  144.  
  145. TestBasic:
  146. ON ERROR GOTO WarningBASICA '1295
  147. PLAY "p16"
  148.  
  149. WarningBASICA:
  150. COLOR 31, 0, 0
  151. PRINT "THIS PROGRAM REQUIRES ADVANCED BASIC -- USE COMMAND 'BASICA'": COLOR 15, 0, 0: FOR I = 1 TO 9000: NEXT:
  152. RESUME Escape '1298
  153.  
  154. MakeDonkey:
  155. DRAW "S08"
  156. DRAW "BM14,18"
  157. DRAW "M+2,-4R8M+1,-1U1M+1,+1M+2,-1"
  158. DRAW "M-1,1M+1,3M-1,1M-1,-2M-1,2"
  159. DRAW "D3L1U3M-1,1D2L1U2L3D2L1U2M-1,-1"
  160. DRAW "D3L1U5M-2,3U1"
  161. PAINT (21, 14), 3
  162. PRESET (37, 10): PRESET (40, 10)
  163. PRESET (37, 11): PRESET (40, 11)
  164. GET (13, 0)-(45, 25), DNK%()
  165.  
  166. MakeCar:
  167. DRAW "S8C3"
  168. DRAW "BM12,1r3m+1,3d2R1ND2u1r2d4l2u1l1"
  169. DRAW "d7R1nd2u2r3d6l3u2l1d3m-1,1l3"
  170. DRAW "m-1,-1u3l1d2l3u6r3d2nd2r1u7l1d1l2"
  171. DRAW "u4r2d1nd2R1U2"
  172. DRAW "M+1,-3"
  173. DRAW "BD10D2R3U2M-1,-1L1M-1,1"
  174. DRAW "BD3D1R1U1L1BR2R1D1L1U1"
  175. DRAW "BD2BL2D1R1U1L1BR2R1D1L1U1"
  176. DRAW "BD2BL2D1R1U1L1BR2R1D1L1U1"
  177. LINE (0, 0)-(40, 60), , B
  178. PAINT (1, 1)
  179. REM DIM CAR%(900)
  180. GET (1, 1)-(28, 44), CAR%() 'Modified "29" and "45" for a line that appeared on the side of the car
  181.  
  182.  

If I'll find fun sounds I'll substuite to SOUND!
Thanks to share
« Last Edit: May 18, 2020, 05:29:03 am by TempodiBasic »
Programming isn't difficult, only it's  consuming time and coffee

Offline +KZ

  • Newbie
  • Posts: 21
  • an ugly avatar :)
    • View Profile
Re: Donkey.bas adapted to qb64
« Reply #5 on: May 18, 2020, 04:46:37 pm »
Wow
I find fine thess old games
but all these spaghetti are a temptation!

So I digest them by GOSUB/RETURN meatballs! :-)
Code: QB64: [Select]
  1. '==============
  2.  
  3. ' **** Donkey ****
  4.  
  5. 'THIS IS ONLY AN ADAPTATION FROM QuickBasic DONKEY.BAS TO QB64
  6. 'Adapted Because DONKEY.BAS (QuickBasic) run so fast when compile with QB64
  7.  
  8. '-----------------
  9. ' 2020 05 18 1.43 AM   porting from spaghetti structure(GOTO) to meatball structure (GOSUB)
  10. '**************
  11. 'Used QuickBasic DONKEY.BAS (from https://web.archive.org/web/20050405104141/http://www.jujusoft.com/drivey/DONKEYQB.BAS.html) as base
  12. 'Used GW-BASIC DONKEY.BAS (from http://peyre.x10.mx/GWBASIC/) as guide
  13. 'Used "PC-BASIC" (https://robhagemans.github.io/pcbasic/) to run GW-BASIC DONKEY.BAS
  14.  
  15. 'Added some DELAYs to make the program run like GW-BASIC version (on PC-BASIC)
  16.  
  17. 'TO DO:
  18. ' * If possible, Make the game sound dont delay (For example when you press space)
  19.  
  20. '===============
  21.  
  22. REM The IBM Personal Computer Donkey
  23. REM Version 1.10 (C)Copyright IBM Corp 1981, 1982
  24. REM Licensed Material - Program Property of IBM
  25. DEF SEG: POKE 106, 0
  26. SAMPLES$ = "NO"
  27. DIM CAR%(900)
  28. GOSUB StartScreen 'GOTO 1010
  29. SAMPLES$ = "YES"
  30.  
  31.  
  32. StartGraphic:
  33. DEFINT A-Y
  34. SCREEN 1, 0: COLOR 8, 1
  35. DIM Q%(500)
  36. DIM D1%(150), D2%(150), C1%(200), C2%(200)
  37. DIM DNK%(300)
  38. GOSUB MakeDonkey
  39. GOSUB MakeCar
  40. DIM B%(300)
  41. FOR I = 2 TO 300: B%(I) = -16384 + 192: NEXT
  42. B%(0) = 2: B%(1) = 193
  43.  
  44.    1540 REM
  45.     CX = 110: CLS
  46.     LINE (0, 0)-(305, 199), , B
  47.     LINE (6, 6)-(97, 195), 1, BF
  48.     LINE (183, 6)-(305, 195), 1, BF
  49.     LOCATE 3, 5: PRINT "Donkey"
  50.     LOCATE 3, 29: PRINT "Driver"
  51.     LOCATE 19, 25: PRINT "Press Space ";
  52.     LOCATE 20, 25: PRINT "Bar to switch";
  53.     LOCATE 21, 25: PRINT "lanes ";
  54.     LOCATE 23, 25: PRINT "Press ESC ";
  55.     LOCATE 24, 25: PRINT "to exit ";
  56.     FOR Y = 4 TO 199 STEP 20: LINE (140, Y)-(140, Y + 10): NEXT
  57.     CY = 105: CX = 105
  58.     LINE (100, 0)-(100, 199): LINE (180, 0)-(180, 199)
  59.     DO '1670
  60.         LOCATE 5, 6: PRINT SD: LOCATE 5, 31: PRINT SM
  61.         CY = CY - 4: IF CY < 60 THEN GOSUB DonkeyLoss: EXIT DO '2230
  62.         PUT (CX, CY), CAR%(), PRESET
  63.         DX = 105 + 42 * INT(RND * 2)
  64.         FOR Y = (RND * -4) * 8 TO 124 STEP 6
  65.  
  66.             'Delay added
  67.             _DELAY 0.05
  68.  
  69.             SOUND 20000, 0.9 'Modified SOUND Duration
  70.             A$ = INKEY$: IF A$ = CHR$(27) THEN GOSUB Escape ELSE POKE 106, 0:
  71.             IF LEN(A$) > 0 THEN LINE (CX, CY)-(CX + 28, CY + 44), 0, BF: CX = 252 - CX: PUT (CX, CY), CAR%(), PRESET: SOUND 200, 1
  72.             IF Y >= 3 THEN PUT (DX, Y), DNK%(), PSET
  73.             IF CX = DX AND Y + 25 >= CY THEN GOSUB Collision: EXIT DO '2060
  74.             IF Y AND 3 THEN PUT (140, 6), B%()
  75.         NEXT
  76.         : LINE (DX, 124)-(DX + 32, 149), 0, BF:
  77.     LOOP 'GOTO 1670
  78.  
  79. Collision:
  80. SD = SD + 1: LOCATE 14, 6: PRINT "BOOM!"
  81. GET (DX, Y)-(DX + 16, Y + 25), D1%()
  82. D1X = DX: D1Y = Y: D2X = DX + 17
  83. GET (DX + 17, Y)-(DX + 31, Y + 25), D2%()
  84. GET (CX, CY)-(CX + 14, CY + 44), C1%()
  85. GET (CX + 15, CY)-(CX + 28, CY + 44), C2%()
  86. C1X = CX: C1Y = CY: C2X = CX + 15
  87. FOR P = 6 TO 0 STEP -1: Z = 1 / (2 ^ P): Z1 = 1 - Z
  88.  
  89.     'Delay added too
  90.     _DELAY 0.20
  91.  
  92.     PUT (C1X, C1Y), C1%(): PUT (C2X, C1Y), C2%()
  93.     PUT (D1X, D1Y), D1%(): PUT (D2X, D1Y), D2%()
  94.     C1X = CX * Z1: D1Y = Y * Z1: C2X = C2X + (291 - C2X) * Z
  95.     D1X = DX * Z1: C1Y = C1Y + (155 - C1Y) * Z: D2X = D2X + (294 - D2X) * Z
  96.     PUT (C1X, C1Y), C1%(): PUT (C2X, C1Y), C2%()
  97.     PUT (D1X, D1Y), D1%(): PUT (D2X, D1Y), D2%()
  98.     SOUND 37 + RND * 200, 4:
  99. FOR Y = 1 TO 2000: NEXT
  100.  
  101. 'More Delay
  102. _DELAY 0.25
  103.  
  104. CLS: 'GOTO 1540
  105.  
  106. DonkeyLoss:
  107. SM = SM + 1: LOCATE 7, 25: PRINT "Donkey loses!"
  108. FOR Y = 1 TO 1000: NEXT
  109. CLS: 'GOTO 1540
  110.  
  111. StartScreen:
  112. KEY OFF: SCREEN 0, 1: COLOR 15, 0, 0: WIDTH 40: CLS: LOCATE 5, 19: PRINT "IBM"
  113. LOCATE 7, 12, 0: PRINT "Personal Computer"
  114. COLOR 10, 0: LOCATE 10, 9, 0: PRINT CHR$(213) + STRING$(21, 205) + CHR$(184)
  115. LOCATE 11, 9, 0: PRINT CHR$(179) + "       DONKEY        " + CHR$(179)
  116. LOCATE 12, 9, 0: PRINT CHR$(179) + STRING$(21, 32) + CHR$(179)
  117. LOCATE 13, 9, 0: PRINT CHR$(179) + "    Version 1.10     " + CHR$(179)
  118. LOCATE 14, 9, 0: PRINT CHR$(212) + STRING$(21, 205) + CHR$(190)
  119. COLOR 15, 0: LOCATE 17, 4, 0: PRINT "(C) Copyright IBM Corp 1981, 1982"
  120. COLOR 14, 0: LOCATE 23, 7, 0: PRINT "Press space bar to continue"
  121.     CMD$ = INKEY$
  122.     IF CMD$ = CHR$(27) THEN GOSUB Escape 'GOTO 1298
  123.     IF CMD$ = " " THEN GOSUB TestAdapter 'GOTO 1160
  124.  
  125. TestAdapter:
  126. DEF SEG = 0
  127. IF (PEEK(&H410) AND &H30) = &H30 THEN
  128.     WIDTH 80: CLS: LOCATE 3, 1
  129.     PRINT "HOLD IT!"
  130.     PRINT "YOU'RE NOT USING THE COLOR/GRAPHICS MONITOR ADAPTER!"
  131.     PRINT "THIS PROGRAM USES GRAPHICS AND REQUIRES THAT ADAPTER."
  132.     PRINT "PRESS THE SPACE BAR TO CONTINUE."
  133.     DEF SEG
  134.     DO WHILE INKEY$ = ""
  135.         CMD$ = INKEY$
  136.         IF CMD$ = CHR$(27) THEN GOSUB Escape 'GOTO 1298
  137.         IF CMD$ = " " THEN GOSUB Escape 'GOTO 1298
  138.     LOOP
  139.     DEF SEG: GOSUB TestBasic 'GOTO 1291
  140.     GOSUB StartGraphic
  141.  
  142. Escape:
  143. SCREEN 0, 1: COLOR 7, 0, 0: CLS: END
  144.  
  145. TestBasic:
  146. ON ERROR GOTO WarningBASICA '1295
  147. PLAY "p16"
  148.  
  149. WarningBASICA:
  150. COLOR 31, 0, 0
  151. PRINT "THIS PROGRAM REQUIRES ADVANCED BASIC -- USE COMMAND 'BASICA'": COLOR 15, 0, 0: FOR I = 1 TO 9000: NEXT:
  152. RESUME Escape '1298
  153.  
  154. MakeDonkey:
  155. DRAW "S08"
  156. DRAW "BM14,18"
  157. DRAW "M+2,-4R8M+1,-1U1M+1,+1M+2,-1"
  158. DRAW "M-1,1M+1,3M-1,1M-1,-2M-1,2"
  159. DRAW "D3L1U3M-1,1D2L1U2L3D2L1U2M-1,-1"
  160. DRAW "D3L1U5M-2,3U1"
  161. PAINT (21, 14), 3
  162. PRESET (37, 10): PRESET (40, 10)
  163. PRESET (37, 11): PRESET (40, 11)
  164. GET (13, 0)-(45, 25), DNK%()
  165.  
  166. MakeCar:
  167. DRAW "S8C3"
  168. DRAW "BM12,1r3m+1,3d2R1ND2u1r2d4l2u1l1"
  169. DRAW "d7R1nd2u2r3d6l3u2l1d3m-1,1l3"
  170. DRAW "m-1,-1u3l1d2l3u6r3d2nd2r1u7l1d1l2"
  171. DRAW "u4r2d1nd2R1U2"
  172. DRAW "M+1,-3"
  173. DRAW "BD10D2R3U2M-1,-1L1M-1,1"
  174. DRAW "BD3D1R1U1L1BR2R1D1L1U1"
  175. DRAW "BD2BL2D1R1U1L1BR2R1D1L1U1"
  176. DRAW "BD2BL2D1R1U1L1BR2R1D1L1U1"
  177. LINE (0, 0)-(40, 60), , B
  178. PAINT (1, 1)
  179. REM DIM CAR%(900)
  180. GET (1, 1)-(28, 44), CAR%() 'Modified "29" and "45" for a line that appeared on the side of the car
  181.  
  182.  

If I'll find fun sounds I'll substuite to SOUND!
Thanks to share

Nice
google translate :0