home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 32 / hot34.iso / ficheros / VDUKE / HELP1O1.ZIP / HELPER2.BAS < prev    next >
BASIC Source File  |  1997-06-24  |  7KB  |  244 lines

  1. ' This is the source code for MapBuddy. PLEASE run this file if you can
  2. 'instead of the EXE because this has some really cool FX :)
  3. 'The compiler I have sucks hard and it just doesn't want to handle
  4. 'all the math I guess.
  5. 'Some of the Subroutines in here I didn't make, I just modified and used.
  6. 'Thanx to PHOBIA for the cool letter burning thing, The WARP effect
  7. 'I forgot where I found but Thanx to whoever put that on the 'Net too!
  8. 'This is freeware but please if you're going to upload it, upload the
  9. 'origional ZIP file will ya? I REALLY dont want to download someone else's
  10. 'revisions plus this program.
  11. '
  12. 'On a lighter note, If you have any handy revisions or SUBS you think
  13. 'I should add or and BUGS I should look into, PLEASE feel free to E-MAIL
  14. 'me at the following address:    CoolMrGeoff@Juno.com
  15. 'You should go to Juno.com, they'll give ya a free email address AND
  16. 'It comes with a nifty JUNO dialer and browser, complete with spell check!
  17.  
  18. DECLARE SUB newcl ()                           'This sets up the SUBS
  19. DECLARE SUB BurnPrint (y%, X%, text$, iter%)   '<-- Cool BURNPRINT routine!
  20. DECLARE SUB PAL ()                             '<-- Custom PALETTE for
  21.                                                '    BURNPRINT
  22. DEFINT A-Z:
  23.  
  24. ' Title Screen
  25. SCREEN 13:
  26. CALL PAL
  27. CALL BurnPrint(11, 9, "MapBuddy Build Utility", 16)
  28. ' End of Title Screen
  29.  
  30. ' Blue fade in all and half out.
  31. 2 CLS
  32.   DEFINT A-Z: SCREEN 12: CLS
  33.   red = 0
  34.   blue = 0
  35.   green = 0
  36.   FOR blue = 1 TO 63
  37.   BACKCOLOR& = 65536 * blue + 256 * green + red
  38.   PALETTE 0, BACKCOLOR&
  39.   FOR w = 1 TO 10000: NEXT w
  40.   NEXT blue
  41.   FOR blue = 63 TO 32 STEP -1
  42.   BACKCOLOR& = 65536 * blue + 256 * green + red
  43.   PALETTE 0, BACKCOLOR&
  44.   FOR w = 1 TO 10000: NEXT w
  45.   NEXT blue
  46. 'End of Blue fade effect
  47.  
  48. 'Start of the Menu code...
  49.   DIM Sine%(360), Cosine%(360)
  50.   DIM StarAngle%(100), StarDistance%(100)
  51.   DIM OldStarX%(100), OldStarY%(100)
  52.   DIM StarTransX%(100), StarTransY%(100)
  53.   DIM StarSpeed%(100)
  54.   NumStars% = 100
  55.  
  56.    
  57.     FOR N% = 0 TO 360
  58.         Sine%(N%) = SIN(N% / 57.2958) * 10
  59.         Cosine%(N%) = COS(N% / 57.2958) * 10
  60.     NEXT N%
  61.  
  62.     FOR N% = 1 TO NumStars%
  63.         StarAngle%(N%) = INT((360 - 1 + 1) * RND + 1)
  64.         StarDistance%(N%) = INT((1000 - 1 + 1) * RND + 1)
  65.         StarSpeed%(N%) = INT((100 - 1 + 1) * RND + 1)
  66.     NEXT N%
  67.  
  68.     SCREEN 12
  69.     WINDOW (-10000, -10000)-(10000, 10000)
  70.     DO
  71.   LOCATE 8, 21
  72.   PRINT "MapBuddy Map Building Utility Version 1.1"
  73.   LOCATE 10, 26
  74.   PRINT "Programmed by: Geoff Traugott"
  75.   LOCATE 13, 27
  76.   IF mapname$ = "" THEN 244
  77.   PRINT "1. Start Building "; mapname$
  78. 245 LOCATE 14, 27
  79.   PRINT "2. Change Map Name to Edit (Do FIRST!!!)"
  80.   LOCATE 15, 27
  81.   PRINT "3. Instructions and Info."
  82.   LOCATE 16, 27
  83.   PRINT "4. Exit to DOS"
  84.   LOCATE 18, 20
  85.  
  86.        FOR N% = 1 TO NumStars%
  87.            StarDistance%(N%) = (StarDistance%(N%) + StarSpeed%(N%)) MOD 1000
  88.            StarTransX%(N%) = (Cosine%(StarAngle%(N%))) - (Sine%(StarAngle%(N%))) * StarDistance%(N%)
  89.            StarTransY%(N%) = (Sine%(StarAngle%(N%))) + (Cosine%(StarAngle%(N%))) * StarDistance%(N%)
  90.        NEXT N%
  91.  
  92.        FOR N% = 1 TO NumStars%
  93.            PSET (OldStarX%(N%), OldStarY%(N%)), 0
  94.            PSET (StarTransX%(N%), StarTransY%(N%)), StarDistance%(N%) \ 68 + 17
  95.            OldStarX%(N%) = StarTransX%(N%)
  96.            OldStarY%(N%) = StarTransY%(N%)
  97.        NEXT N%
  98.        key$ = INKEY$
  99.        FOR grets = 1 TO 10000: NEXT grets
  100.     LOOP UNTIL key$ <> ""
  101.     IF key$ = "1" THEN 12
  102.     IF key$ = "2" THEN 13
  103.     IF key$ = "3" THEN 14
  104.     IF key$ = "4" THEN 231
  105.     GOTO 2
  106.  
  107. ' The PICK YOUR MAP screen
  108. 14 SCREEN 0
  109. LOCATE 1, 1
  110. SHELL "Type info.dat|more"
  111. INPUT "-Press enter when done-", inou$
  112. GOTO 2
  113. 13 CLS
  114. PRINT "What is the name of the .map file you will be building?"
  115. PRINT "It is VERY important that you type this correctly,"
  116. PRINT "because if it is wrong it wont run OR build the correct map!"
  117. PRINT "If you were building SAMPLE.MAP you would enter SAMPLE as the"
  118. PRINT "name."
  119. PRINT
  120. 532 INPUT "What is the map name WITHOUT the extention :", mapnam$
  121. mapname$ = mapnam$ + ".map"
  122. PRINT "You are building "; mapname$; " .. Correct? (Y,N)"
  123. INPUT cor$
  124. IF cor$ = "n" THEN GOTO 532
  125. IF cor$ = "N" THEN 532
  126. GOTO 2
  127. 12 REM
  128.  '
  129.  '
  130.  '
  131.  'Main Code
  132.   FOR blue = 32 TO 0 STEP -1
  133.   BACKCOLOR& = 65536 * blue + 256 * green + red
  134.   PALETTE 0, BACKCOLOR&
  135.   FOR w = 1 TO 10000: NEXT w
  136.   NEXT blue
  137.   SCREEN 0
  138. 3 PRINT "Building "; mapname$
  139.   shellstringone$ = "Build " + mapname$
  140.   SHELL shellstringone$
  141.   PRINT "1. Test Map"
  142.   PRINT "2. Quit"
  143.   INPUT R
  144.   IF R = 2 THEN GOTO 2
  145.   shellstringtwo$ = "Duke3d -map " + mapname$
  146.   SHELL shellstringtwo$
  147.   PRINT "1. Build Map"
  148.   PRINT "2. Quit"
  149.   INPUT R
  150.   IF R = 2 THEN GOTO 2
  151.   GOTO 3
  152. 231  FOR blue = 32 TO 0 STEP -1
  153.    BACKCOLOR& = 65536 * blue + 256 * green + red
  154.    PALETTE 0, BACKCOLOR&
  155.    FOR w = 1 TO 10000: NEXT w
  156.    NEXT blue
  157.   newcl
  158.  END
  159. 244 PRINT "--==** No map selected **==--"
  160. GOTO 245
  161.  
  162. SUB BurnPrint (y%, X%, text$, iter%)
  163. ' Sin Table
  164. DIM sn(360)
  165. FOR R = 0 TO 360
  166. sn(R) = SIN(R)
  167. NEXT
  168.  
  169. ' PRINT THE TEXT
  170. COLOR 48: LOCATE y%, X%
  171. PRINT text$
  172.  
  173. ' WAIT KEYPRESS
  174. DO: LOOP WHILE INKEY$ = ""
  175.  
  176. ' CALCULATE TEXT POSITION
  177.  
  178. lenght = LEN(text$)
  179.  
  180. xstart = (X * 8) - 8
  181. xend = ((X + lenght) * 8) - 8
  182. ystart = (y * 8) - 16
  183. yend = (y * 8) - 8
  184.  
  185. FOR R = 1 TO iter%
  186.  
  187. FOR y = ystart TO yend + 8
  188. FOR X = xstart TO xend
  189.  
  190. col = FIX(POINT(X + sn(a), y) + POINT(X, y + 1)) / 2 - (3 * RND)
  191. IF col < 0 THEN col = 0
  192. PSET (X, y), col
  193. a = a + 1: IF a = 360 THEN a = 0
  194. NEXT X
  195. NEXT y
  196. NEXT R
  197.  
  198. END SUB
  199.  
  200. SUB newcl
  201.     DIM ScreenPos%(2000)
  202.     FOR X% = 1 TO 2000
  203.         ScreenPos%(X%) = X%
  204.     NEXT X%
  205.  
  206.     FOR X% = 1 TO 2000
  207.         SWAP ScreenPos%(X%), ScreenPos%(INT(RND(1) * 2000) + 1)
  208.     NEXT X%
  209.  
  210.     FOR X% = 1 TO 2000
  211.         R% = ScreenPos%(X%) \ 80 + 1
  212.         IF R% = 0 THEN R% = 1
  213.         IF R% > 25 THEN R% = 25
  214.         C% = ABS(ScreenPos%(X%) - (80 * R%))
  215.         IF C% = 0 THEN C% = 1
  216.         LOCATE R%, C%
  217.         PRINT " ";
  218.     NEXT X%
  219.  
  220.     LOCATE 1, 80: PRINT " ";   ' cheap temporary fix
  221.  
  222. END SUB
  223.  
  224. SUB PAL
  225. ' MADE BY PHOBIA
  226.  
  227. ' setup palette (Made By PHOBIA)
  228. FOR Ac% = 0 TO 63
  229. OUT &H3C7, Ac% / 4
  230. OUT &H3C9, Ac%
  231. OUT &H3C9, 0
  232. OUT &H3C9, 0
  233. OUT &H3C7, Ac% / 4 + 16
  234. OUT &H3C9, 63
  235. OUT &H3C9, Ac%
  236. OUT &H3C9, 0
  237. OUT &H3C7, Ac% / 4 + 32
  238. OUT &H3C9, 63
  239. OUT &H3C9, 63
  240. OUT &H3C9, Ac%
  241. NEXT
  242. END SUB
  243.  
  244.